Module: ArTransactionChanges

Defined in:
lib/ar_transaction_changes.rb,
lib/ar_transaction_changes/version.rb

Constant Summary collapse

VERSION =
"1.1.8"

Instance Method Summary collapse

Instance Method Details

#_run_commit_callbacksObject



7
8
9
10
11
# File 'lib/ar_transaction_changes.rb', line 7

def _run_commit_callbacks
  super
ensure
  @transaction_changed_attributes = nil
end

#_run_rollback_callbacksObject



13
14
15
16
17
# File 'lib/ar_transaction_changes.rb', line 13

def _run_rollback_callbacks
  super
ensure
  @transaction_changed_attributes = nil
end

#_write_attribute(attr_name, value) ⇒ Object



23
24
25
26
27
# File 'lib/ar_transaction_changes.rb', line 23

def _write_attribute(attr_name, value)
  _store_transaction_changed_attributes(attr_name) do
    super(attr_name, value)
  end
end

#transaction_changed_attributesObject



19
20
21
# File 'lib/ar_transaction_changes.rb', line 19

def transaction_changed_attributes
  @transaction_changed_attributes ||= HashWithIndifferentAccess.new
end

#write_attribute(attr_name, value) ⇒ Object



30
31
32
33
34
# File 'lib/ar_transaction_changes.rb', line 30

def write_attribute(attr_name, value)
  _store_transaction_changed_attributes(attr_name) do
    super(attr_name, value)
  end
end