From 959fb8ea651fa6638aaa7caced20d921ca2ea5c1 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Thu, 7 Jun 2012 20:02:49 +0100 Subject: Revert "Perf: Don't load the association for #delete_all." This reverts commit b98d1e21635d8776de8893cc09bd86c71f6c78f0. Closes #6609 Conflicts: activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb --- .../lib/active_record/associations/has_many_through_association.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb') diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 86c665b5fe..53d49fef2e 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -126,10 +126,6 @@ module ActiveRecord def delete_records(records, method) ensure_not_nested - # This is unoptimised; it will load all the target records - # even when we just want to delete everything. - records = load_target if records == :all - scope = through_association.scoped.where(construct_join_attributes(*records)) case method -- cgit v1.2.3