diff options
Diffstat (limited to 'activerecord/test/models/parrot.rb')
-rw-r--r-- | activerecord/test/models/parrot.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/activerecord/test/models/parrot.rb b/activerecord/test/models/parrot.rb index e76e83f314..ddc9dcaf29 100644 --- a/activerecord/test/models/parrot.rb +++ b/activerecord/test/models/parrot.rb @@ -11,7 +11,7 @@ class Parrot < ActiveRecord::Base attr_accessor :cancel_save_from_callback before_save :cancel_save_callback_method, :if => :cancel_save_from_callback def cancel_save_callback_method - false + throw(:abort) end end @@ -19,11 +19,5 @@ class LiveParrot < Parrot end class DeadParrot < Parrot - belongs_to :killer, :class_name => 'Pirate' -end - -class FunkyParrot < Parrot - before_destroy do - raise "before_destroy was called" - end + belongs_to :killer, :class_name => 'Pirate', foreign_key: :killer_id end |