Module: AfterCommitChanges

Defined in:
lib/after_commit_changes.rb

Constant Summary collapse

VERSION =
File.read(File.expand_path("../VERSION", __dir__)).strip

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/after_commit_changes.rb', line 6

def self.included(base)
  base.before_commit do
    rollup_mutations_for_transaction!
  end

  base.after_save do
    @after_commit_saved_changes ||= []
    @after_commit_saved_changes << saved_changes
  end
end