aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/associations/preloader/through_association.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/through_association.rb b/activerecord/lib/active_record/associations/preloader/through_association.rb
index d35ffafe97..2c625cec04 100644
--- a/activerecord/lib/active_record/associations/preloader/through_association.rb
+++ b/activerecord/lib/active_record/associations/preloader/through_association.rb
@@ -32,12 +32,10 @@ module ActiveRecord
owners.each_with_object({}) do |owner, h|
association = owner.association through_reflection.name
- through_records = Array(association.reader)
+ h[owner] = Array(association.reader)
# Dont cache the association - we would only be caching a subset
association.reset if should_reset
-
- h[owner] = through_records
end
end