Skip to content

Commit

Permalink
lhs preload is always a single preload, so just preload one
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Sep 20, 2013
1 parent a04965b commit 931a6ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord/lib/active_record/associations/preloader.rb
Expand Up @@ -112,10 +112,10 @@ def preload(association)
end end


def preload_hash(association) def preload_hash(association)
association.each do |parent, child| association.flat_map { |parent, child|
Preloader.new(records, parent, preload_scope).run preload_one parent
Preloader.new(records.map { |record| record.send(parent) }.flatten, child).run Preloader.new(records.map { |record| record.send(parent) }.flatten, child).run
end }
end end


# Not all records have the same class, so group then preload group on the reflection # Not all records have the same class, so group then preload group on the reflection
Expand Down

0 comments on commit 931a6ab

Please sign in to comment.