module AfterCommitQueue
Constants
- VERSION
Public Instance Methods
run_after_commit(method = nil, &block)
click to toggle source
Public: Add method to after commit queue
# File lib/after_commit_queue.rb, line 10 def run_after_commit(method = nil, &block) _after_commit_queue << Proc.new { self.send(method) } if method _after_commit_queue << block if block true end
Protected Instance Methods
_after_commit_queue()
click to toggle source
Protected: Return after commit queue Returns: Array with methods to run
# File lib/after_commit_queue.rb, line 29 def _after_commit_queue @after_commit_queue ||= [] end
_clear_after_commit_queue()
click to toggle source
# File lib/after_commit_queue.rb, line 33 def _clear_after_commit_queue _after_commit_queue.clear end
_run_after_commit_queue()
click to toggle source
Protected: Is called as after_commit callback runs methods from the queue and clears the queue afterwards
# File lib/after_commit_queue.rb, line 20 def _run_after_commit_queue _after_commit_queue.each do |action| self.instance_eval &action end @after_commit_queue.clear end