Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

read the association instead of sending

  • Loading branch information...
commit 396b1951fc91e5aecf499ca5602995f61cda59a3 1 parent e95bc57
@tenderlove tenderlove authored
View
4 activerecord/lib/active_record/associations/preloader/through_association.rb
@@ -47,7 +47,9 @@ def associated_records_by_owner(preloader)
records_by_owner[lhs] = pl_to_middle.flat_map do |pl, middles|
rhs_records = middles.flat_map { |r|
- r.send(source_reflection.name)
+ association = r.association source_reflection.name
+
+ association.reader
}.compact
rhs_records.sort_by { |rhs| record_offset[rhs] }
Please sign in to comment.
Something went wrong with that request. Please try again.