instance method
remember_transaction_record_state
Ruby on Rails edge
Since v3.0.20 Private — implementation detail, not part of the public APISignature
remember_transaction_record_state()
Save the new record state and id of a record so it can be restored later if a transaction fails.
Source
# File activerecord/lib/active_record/transactions.rb, line 466
def remember_transaction_record_state
@_start_transaction_state ||= {
id: id,
new_record: @new_record,
previously_new_record: @previously_new_record,
destroyed: @destroyed,
attributes: @attributes,
frozen?: frozen?,
level: 0
}
@_start_transaction_state[:level] += 1
if _committed_already_called
@_new_record_before_last_commit = false
else
@_new_record_before_last_commit = @_start_transaction_state[:new_record]
end
end
Defined in activerecord/lib/active_record/transactions.rb line 466
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Transactions