mirror of https://github.com/rails/rails
Remove ensure from with_transaction_returning_status
The test added in12b0b26df7
passes even without this code since9b8c7796a9
, 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` incaae79a385
, 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 in48007d5390
, this code is no longer needed.
This commit is contained in:
parent
aea9c9a1ed
commit
d8a9bc02f3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue