Permalink
Browse files

fix method name

  • Loading branch information...
1 parent ec7cc6a commit 7f55ef8c4dee5b26a9174d7dc2ebcbc6bb93af06 @tenderlove tenderlove committed Sep 20, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 activerecord/lib/active_record/associations/preloader.rb
@@ -102,14 +102,14 @@ def preloaders
@preloaders = []
else
@preloaders = associations.flat_map { |association|
- preload(association, records)
+ preloaders_on association, records
}
end
end
private
- def preload(association, records)
+ def preloaders_on(association, records)
case association
when Hash
preloaders_for_hash(association, records)
@@ -128,7 +128,9 @@ def preloaders_for_hash(association, records)
loaders = preloaders_for_one parent, records
recs = loaders.flat_map(&:target_records).uniq
- loaders.concat Array.wrap(child).flat_map { |assoc| preload assoc, recs }
+ loaders.concat Array.wrap(child).flat_map { |assoc|
+ preloaders_on assoc, recs
+ }
end
# Not all records have the same class, so group then preload group on the reflection

0 comments on commit 7f55ef8

Please sign in to comment.