diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-09-20 16:22:31 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-09-20 16:22:31 -0700 |
commit | 7f55ef8c4dee5b26a9174d7dc2ebcbc6bb93af06 (patch) | |
tree | 15163cbd714fe09b76919a86a0e7798abf570e40 /activerecord | |
parent | ec7cc6aa176e94c79eba7a1b04360f13eaa328c0 (diff) | |
download | rails-7f55ef8c4dee5b26a9174d7dc2ebcbc6bb93af06.tar.gz rails-7f55ef8c4dee5b26a9174d7dc2ebcbc6bb93af06.tar.bz2 rails-7f55ef8c4dee5b26a9174d7dc2ebcbc6bb93af06.zip |
fix method name
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index 3ca07498c5..4ef361fccf 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -102,14 +102,14 @@ module ActiveRecord @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 @@ module ActiveRecord 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 |