restore_transaction_record_state(force = false)
protected
Restore the new record state and id of a record that was previously saved
by a call to save_record_state.
# File activerecord/lib/active_record/transactions.rb, line 383
def restore_transaction_record_state(force = false) #:nodoc:
unless @_start_transaction_state.empty?
transaction_level = (@_start_transaction_state[:level] || 0) - 1
if transaction_level < 1 || force
restore_state = @_start_transaction_state
thaw unless restore_state[:frozen?]
@new_record = restore_state[:new_record]
@destroyed = restore_state[:destroyed]
write_attribute(self.class.primary_key, restore_state[:id]) if self.class.primary_key
end
end
end