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:
Rob Sanheim
2014-07-11 20:31:37 -07:00
committed by Charlie Somerville
parent 90ded51cc1
commit c957f5f609

View File

@@ -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