From 35f5938c9128718a2c5515524c815def75a53f00 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 22 Dec 2010 18:30:18 -0800 Subject: [PATCH] probably should use the some_ids variable here. o_O --- activerecord/lib/active_record/association_preload.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index fc7c544a55..7f5c5dd2ad 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -216,7 +216,7 @@ def preload_has_and_belongs_to_many_association(records, reflection, preload_opt order(options[:order]) all_associated_records = associated_records(ids) do |some_ids| - associated_records_proxy.where([conditions, ids]).to_a + associated_records_proxy.where([conditions, some_ids]).to_a end set_association_collection_records(id_to_record_map, reflection.name, all_associated_records, 'the_parent_record_id') -- GitLab