mirror of
https://github.com/github/rails.git
synced 2026-01-07 22:04:07 -05:00
only _run_commit_callbacks when destroyed or persisted:
should fix issues with commit callbacks getting called when the record
is not persisted (yet) in a inner transaction or due to some other edge
case.
see also caabed6c76
Conflicts:
activerecord/lib/active_record/transactions.rb
This commit is contained in:
committed by
Charlie Somerville
parent
90ded51cc1
commit
c957f5f609
@@ -278,7 +278,7 @@ module ActiveRecord
|
||||
|
||||
# Call the after_commit callbacks
|
||||
def committed! #:nodoc:
|
||||
run_callbacks :commit
|
||||
run_callbacks :commit if destroyed? || persisted?
|
||||
ensure
|
||||
@_start_transaction_state.clear
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user