diff options
author | brainopia <brainopia@evilmartians.com> | 2014-12-25 23:46:49 +0300 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2015-03-04 15:23:25 +0300 |
commit | 8313797810eefb7e00d0b5a8e91ac02907fa5e8f (patch) | |
tree | 6cca4fb79a0b5e9fe660e1e2f89c9ff1e349b695 /activerecord/lib/active_record/transactions.rb | |
parent | 33ae6344834fdf71b93e0b6db899b58e017a7655 (diff) | |
download | rails-8313797810eefb7e00d0b5a8e91ac02907fa5e8f.tar.gz rails-8313797810eefb7e00d0b5a8e91ac02907fa5e8f.tar.bz2 rails-8313797810eefb7e00d0b5a8e91ac02907fa5e8f.zip |
Fix rollback of frozen records
Diffstat (limited to 'activerecord/lib/active_record/transactions.rb')
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index ffe7c4ae42..ce4b2dfa8e 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -413,13 +413,14 @@ module ActiveRecord transaction_level = (@_start_transaction_state[:level] || 0) - 1 if transaction_level < 1 || force restore_state = @_start_transaction_state - thaw unless restore_state[:frozen?] + thaw @new_record = restore_state[:new_record] @destroyed = restore_state[:destroyed] pk = self.class.primary_key if pk && read_attribute(pk) != restore_state[:id] write_attribute(pk, restore_state[:id]) end + freeze if restore_state[:frozen?] end end end |