remember_transaction_record_state()
private
Save the new record state and id of a record so it can be restored later if
a transaction
fails.
# File activerecord/lib/active_record/transactions.rb, line 443
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