diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 22870fb6c5..4571cc0786 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -505,6 +505,7 @@ module ActiveRecord @destroyed_by_association = nil @new_record = true @txn = nil + @_start_transaction_state = {} @transaction_state = nil @reflects_state = [false] end diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 33c9af3d3d..cf76d53bf7 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -341,7 +341,6 @@ module ActiveRecord # Save the new record state and id of a record so it can be restored later if a transaction fails. def remember_transaction_record_state #:nodoc: - @_start_transaction_state ||= {} @_start_transaction_state[:id] = id if has_attribute?(self.class.primary_key) unless @_start_transaction_state.include?(:new_record) @_start_transaction_state[:new_record] = @new_record @@ -352,7 +351,6 @@ module ActiveRecord @_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 end # Clear the new record state and id of a record. |