diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader/through_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/through_association.rb | 4 |
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 0c0501fd58..15fdba51f3 100644 --- a/activerecord/lib/active_record/associations/preloader/through_association.rb +++ b/activerecord/lib/active_record/associations/preloader/through_association.rb @@ -12,8 +12,6 @@ module ActiveRecord end def associated_records_by_owner(preloader) - @loaded = true - return @associated_records_by_owner if @associated_records_by_owner preloader.preload(owners, @@ -54,7 +52,7 @@ module ActiveRecord r.send(source_reflection.name) }.compact - if pl && pl.loaded? + if pl loaded_records = pl.preloaded_records i = 0 record_index = loaded_records.each_with_object({}) { |r,indexes| |