module TransactionChanges
Constants
- VERSION
Public Instance Methods
_run_commit_callbacks()
click to toggle source
Calls superclass method
# File lib/transaction_changes.rb, line 18 def _run_commit_callbacks super ensure @old_transaction_changes = HashWithIndifferentAccess.new end
_run_rollback_callbacks()
click to toggle source
Calls superclass method
# File lib/transaction_changes.rb, line 24 def _run_rollback_callbacks super ensure @old_transaction_changes = HashWithIndifferentAccess.new end
transaction_changes()
click to toggle source
# File lib/transaction_changes.rb, line 14 def transaction_changes @old_transaction_changes || HashWithIndifferentAccess.new end
Private Instance Methods
accumulate_changes()
click to toggle source
# File lib/transaction_changes.rb, line 36 def accumulate_changes @new_transaction_changes ||= HashWithIndifferentAccess.new attribute_changes = ::ActiveRecord.respond_to?(:version) && ActiveRecord.version.to_s.to_f >= 5.1 ? self.saved_changes : self.changes attribute_changes.each do |key, value| @new_transaction_changes[key] = value end end
setting_variables()
click to toggle source
# File lib/transaction_changes.rb, line 32 def setting_variables @new_transaction_changes, @old_transaction_changes = HashWithIndifferentAccess.new, @new_transaction_changes end