From 0c28247db19f2af9cb71e74f6824715e72f11076 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 27 Aug 2013 15:22:26 -0700 Subject: remove intermediate variable --- .../lib/active_record/associations/preloader/through_association.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activerecord/lib/active_record') 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 -- cgit v1.2.3