aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-09-13 14:58:22 -0300
committerEmilio Tagua <miloops@gmail.com>2010-11-19 19:07:42 -0300
commitfa11c60b4450394b2f4c048c5379bc9487f477c2 (patch)
tree05ceab0081f4c9f58d59219166bfbed191c05f53 /activerecord/lib/active_record
parentdd6e6808153cd033ac5dd3c431f579f640125293 (diff)
downloadrails-fa11c60b4450394b2f4c048c5379bc9487f477c2.tar.gz
rails-fa11c60b4450394b2f4c048c5379bc9487f477c2.tar.bz2
rails-fa11c60b4450394b2f4c048c5379bc9487f477c2.zip
Disable identity map when loading associated records from habtm.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/association_preload.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb
index 065ecf5bf0..54a964f53b 100644
--- a/activerecord/lib/active_record/association_preload.rb
+++ b/activerecord/lib/active_record/association_preload.rb
@@ -199,8 +199,10 @@ module ActiveRecord
select("#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as the_parent_record_id").
order(options[:order])
- all_associated_records = associated_records(ids) do |some_ids|
- associated_records_proxy.where([conditions, ids]).to_a
+ all_associated_records = ActiveRecord::IdentityMap.without do
+ associated_records(ids) do |some_ids|
+ associated_records_proxy.where([conditions, ids]).to_a
+ end
end
set_association_collection_records(id_to_record_map, reflection.name, all_associated_records, 'the_parent_record_id')