Stop identity-mapping the through records in the preloader since I fixed the underlying problem in the habtm preloader.

This commit is contained in:
Jon Leighton
2011-03-04 22:36:44 +00:00
parent b5b5558d2f
commit 4206eff189

View File

@@ -33,13 +33,8 @@ module ActiveRecord
through_options
).run
# TODO: Verify that this is actually necessary and not just a symptom of an
# underlying inefficiency
identity_map = {}
Hash[owners.map do |owner|
through_records = Array.wrap(owner.send(through_reflection.name))
through_records.map! { |record| identity_map[record] ||= record }
# Dont cache the association - we would only be caching a subset
if reflection.options[:source_type] && through_reflection.collection?