aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/transactions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 82adb19f5b..e5397401fd 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -431,7 +431,7 @@ module ActiveRecord
actions.any? do |action|
case action
when :create
- transaction_record_state(:new_record)
+ persisted? && transaction_record_state(:new_record)
when :destroy
defined?(@_trigger_destroy_callback) && @_trigger_destroy_callback
when :update