aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-05-13 11:04:39 +0900
committerGitHub <noreply@github.com>2018-05-13 11:04:39 +0900
commit10b6c65dbcb0731c5bee815dc01f84a30983a871 (patch)
tree04b155e2d1186c5381b509bd174c18d3c9a85be1 /activerecord
parent8cfa34626c56b1e52328194e380d661785a7b082 (diff)
parent48007d5390db47fc1223f57c8e7ab3ebb7c3a3d7 (diff)
downloadrails-10b6c65dbcb0731c5bee815dc01f84a30983a871.tar.gz
rails-10b6c65dbcb0731c5bee815dc01f84a30983a871.tar.bz2
rails-10b6c65dbcb0731c5bee815dc01f84a30983a871.zip
Merge pull request #32878 from eugeneius/rm_rollback_active_record_state
Remove ActiveRecord::Transactions#rollback_active_record_state!
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/transactions.rb15
1 files changed, 1 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 6e9dff5796..20603aaf2d 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -306,9 +306,7 @@ module ActiveRecord
end
def save(*) #:nodoc:
- rollback_active_record_state! do
- with_transaction_returning_status { super }
- end
+ with_transaction_returning_status { super }
end
def save!(*) #:nodoc:
@@ -319,17 +317,6 @@ module ActiveRecord
with_transaction_returning_status { super }
end
- # Reset id and @new_record if the transaction rolls back.
- def rollback_active_record_state!
- remember_transaction_record_state
- yield
- rescue Exception
- restore_transaction_record_state
- raise
- ensure
- clear_transaction_record_state
- end
-
def before_committed! # :nodoc:
_run_before_commit_without_transaction_enrollment_callbacks
_run_before_commit_callbacks