1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #15016 from arthurnn/dup_attr_on_save_state

Dup the changed_attributes otherwise we could lose them
This commit is contained in:
Godfrey Chan 2014-05-07 18:08:06 -07:00
commit bab48f0a3d

View file

@ -350,7 +350,7 @@ module ActiveRecord
end
@_start_transaction_state[:level] = (@_start_transaction_state[:level] || 0) + 1
@_start_transaction_state[:frozen?] = @attributes.frozen?
@_start_transaction_state[:changed_attributes] ||= changed_attributes
@_start_transaction_state[:changed_attributes] ||= changed_attributes.dup
end
# Clear the new record state and id of a record.