diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-05-13 17:10:23 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-06-30 14:50:18 +0530 |
commit | f319e4a9421d8815717fd6ca6191268fed9e536d (patch) | |
tree | 086cf58278e401835cf6a274124b09c0dfa64f18 /activerecord/test/models/parrot.rb | |
parent | 4eedb3928e5555e9d766f7c92637a6341c461efb (diff) | |
download | rails-f319e4a9421d8815717fd6ca6191268fed9e536d.tar.gz rails-f319e4a9421d8815717fd6ca6191268fed9e536d.tar.bz2 rails-f319e4a9421d8815717fd6ca6191268fed9e536d.zip |
Do not invoke callbacks when delete_all is called
Method `delete_all` should not be invoking callbacks and this
feature was deprecated in Rails 4.0. This is being removed.
`delete_all` will continue to honor the `:dependent` option. However
if `:dependent` value is `:destroy` then the default deletion
strategy for that collection will be applied.
User can also force a deletion strategy by passing parameter to
`delete_all`. For example you can do `@post.comments.delete_all(:nullify)`
Diffstat (limited to 'activerecord/test/models/parrot.rb')
-rw-r--r-- | activerecord/test/models/parrot.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/parrot.rb b/activerecord/test/models/parrot.rb index c4ee2bd19d..e76e83f314 100644 --- a/activerecord/test/models/parrot.rb +++ b/activerecord/test/models/parrot.rb @@ -21,3 +21,9 @@ end class DeadParrot < Parrot belongs_to :killer, :class_name => 'Pirate' end + +class FunkyParrot < Parrot + before_destroy do + raise "before_destroy was called" + end +end |