From 63ff495bdf90e0ab20114a49db5cffe3cb9ef2fd Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 19 May 2018 11:46:03 +0900 Subject: Fix dirty tracking after rollback. Currently the rollback only restores primary key value, `new_record?`, `destroyed?`, and `frozen?`. Since the `save` clears current dirty attribute states, retrying save after rollback will causes no change saved if partial writes is enabled (by default). This makes `remember_transaction_record_state` remembers original values then restores dirty attribute states after rollback. Fixes #15018. Fixes #30167. Fixes #33868. Fixes #33443. Closes #33444. Closes #34504. --- activerecord/lib/active_record/core.rb | 6 ------ 1 file changed, 6 deletions(-) (limited to 'activerecord/lib/active_record/core.rb') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 6fed3e5c19..04b21b4d00 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -583,12 +583,6 @@ module ActiveRecord def initialize_internals_callback end - def thaw - if @attributes.frozen? - @attributes = @attributes.dup - end - end - def custom_inspect_method_defined? self.class.instance_method(:inspect).owner != ActiveRecord::Base.instance_method(:inspect).owner end -- cgit v1.2.3