aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-05-07 18:08:06 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-05-07 18:08:06 -0700
commitbab48f0a3d53a08bc23ea0887219e8deb963c3d9 (patch)
tree89499d51335c5bfb0f48aeeab0e89775263937cd /activerecord/lib
parent5ff7c591d3d5231a095afafdf2eea2fa7c70d92e (diff)
parentb0fa7cf3ff8432cc2eef3682b34763b7f8c93cc8 (diff)
downloadrails-bab48f0a3d53a08bc23ea0887219e8deb963c3d9.tar.gz
rails-bab48f0a3d53a08bc23ea0887219e8deb963c3d9.tar.bz2
rails-bab48f0a3d53a08bc23ea0887219e8deb963c3d9.zip
Merge pull request #15016 from arthurnn/dup_attr_on_save_state
Dup the changed_attributes otherwise we could lose them
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/transactions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index cf76d53bf7..e31d28cfd1 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -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.