From b0fa7cf3ff8432cc2eef3682b34763b7f8c93cc8 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Wed, 7 May 2014 19:11:37 -0400 Subject: Dup the changed_attributes otherwise we could lose them --- activerecord/lib/active_record/transactions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') 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. -- cgit v1.2.3