diff options
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 9bf253d976..1c84973920 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -252,10 +252,10 @@ module ActiveRecord end def delete_all_with_dependency(dependent) - if dependent == :delete_all - delete_records(:all, dependent) - else + if dependent == :destroy delete_or_destroy(load_target, dependent) + else + delete_records(:all, dependent) end end |