aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorEugene Kenny <elkenny@gmail.com>2018-11-11 22:35:47 +0000
committerEugene Kenny <elkenny@gmail.com>2018-11-11 22:35:47 +0000
commitd8a9bc02f34bcbc18028db4df87b7fcf8a82b738 (patch)
treecd9553c3df19af64869fe14a3aa122d905ce4abe /activerecord
parentaea9c9a1edee8153cdc24c518803a9d48bf78657 (diff)
downloadrails-d8a9bc02f34bcbc18028db4df87b7fcf8a82b738.tar.gz
rails-d8a9bc02f34bcbc18028db4df87b7fcf8a82b738.tar.bz2
rails-d8a9bc02f34bcbc18028db4df87b7fcf8a82b738.zip
Remove ensure from with_transaction_returning_status
The test added in 12b0b26df7560ab5199ba830586864085441508f passes even without this code since 9b8c7796a9c2048208aa843ad3dc477dffa8bdee, as the call to `id` in `remember_transaction_record_state` now triggers a `sync_with_transaction_state` which discards the leftover state from the previous transaction. This issue had already been fixed for `save!`, `destroy` and `touch` in caae79a385ce112245262a17414bcd96bea013c2, but continued to affect `save` because the call to `rollback_active_record_state!` in that method would increment the transaction level before `add_to_transaction` could clear it, preventing the fix from working correctly. As `rollback_active_record_state!` was removed entirely in 48007d5390db47fc1223f57c8e7ab3ebb7c3a3d7, this code is no longer needed.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/transactions.rb4
1 files changed, 0 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index c5d5fca672..fe3842b905 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -375,10 +375,6 @@ module ActiveRecord
raise ActiveRecord::Rollback unless status
end
status
- ensure
- if @transaction_state && @transaction_state.committed?
- clear_transaction_record_state
- end
end
private