diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-05-05 02:53:32 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-05 02:53:32 +0900 |
commit | 5eaec23b89a83763b59bd017d872d35feea70af1 (patch) | |
tree | d65c119951299ccb02902a7b813402c88c307a52 /activerecord/lib/active_record/transactions.rb | |
parent | 99e4bb735d955318a7503c404d83c3314350ba20 (diff) | |
parent | a779b1a08bb73be2b50d42ae69b3946de98e5af4 (diff) | |
download | rails-5eaec23b89a83763b59bd017d872d35feea70af1.tar.gz rails-5eaec23b89a83763b59bd017d872d35feea70af1.tar.bz2 rails-5eaec23b89a83763b59bd017d872d35feea70af1.zip |
Merge pull request #32807 from bdurand/fix_committed_disable_callbacks
Fix logic on disabling afer_commit callbacks
Diffstat (limited to 'activerecord/lib/active_record/transactions.rb')
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 97cba5d1c7..be4f41050e 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -340,7 +340,7 @@ module ActiveRecord # Ensure that it is not called if the object was never persisted (failed create), # but call it after the commit of a destroyed object. def committed!(should_run_callbacks: true) #:nodoc: - if should_run_callbacks && destroyed? || persisted? + if should_run_callbacks && (destroyed? || persisted?) _run_commit_without_transaction_enrollment_callbacks _run_commit_callbacks end |