Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

the preloader for the RHS has all the preloaded records, so ask it

  • Loading branch information...
commit 43a63f6d5ec2026dc7c610394aab37613181fff1 1 parent 19b871a
@tenderlove tenderlove authored
View
6 activerecord/lib/active_record/associations/preloader/through_association.rb
@@ -29,6 +29,8 @@ def associated_records_by_owner(preloader)
source_reflection.name,
reflection_scope)
+ @preloaded_records.concat preloaders.flat_map(&:preloaded_records)
+
middle_to_pl = preloaders.each_with_object({}) do |pl,h|
pl.owners.each { |middle|
h[middle] = pl
@@ -53,9 +55,7 @@ def associated_records_by_owner(preloader)
}.compact
record_index = pl_indexes[pl]
- records = rhs_records.sort_by { |rhs| record_index[rhs] }
- @preloaded_records.concat rhs_records
- records
+ rhs_records.sort_by { |rhs| record_index[rhs] }
end
}
end
Please sign in to comment.
Something went wrong with that request. Please try again.