aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb6
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 a0eba60101..9bf253d976 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 (loaded? || dependent == :destroy) && dependent != :delete_all
- delete_or_destroy(load_target, dependent)
- else
+ if dependent == :delete_all
delete_records(:all, dependent)
+ else
+ delete_or_destroy(load_target, dependent)
end
end