aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/pirate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/pirate.rb')
-rw-r--r--activerecord/test/models/pirate.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/models/pirate.rb b/activerecord/test/models/pirate.rb
index d89c8cf381..f2c45053e7 100644
--- a/activerecord/test/models/pirate.rb
+++ b/activerecord/test/models/pirate.rb
@@ -48,7 +48,7 @@ class Pirate < ActiveRecord::Base
end
def reject_empty_ships_on_create(attributes)
- attributes.delete('_reject_me_if_new').present? && new_record?
+ attributes.delete('_reject_me_if_new').present? && !persisted?
end
attr_accessor :cancel_save_from_callback