From d81fbe22ed2e8f37e5bc4971fedf6ba9d3116655 Mon Sep 17 00:00:00 2001 From: schneems Date: Mon, 26 Oct 2015 14:20:27 -0500 Subject: [PATCH] [ci skip] Clarify doc for preloaders_for_one --- activerecord/lib/active_record/associations/preloader.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index c5387eb996..fae955f815 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -132,6 +132,11 @@ def preloaders_for_hash(association, records, scope) } end + # Loads all the given data into +records+ for a singular +association+. + # + # Functions by instantiating a preloader class such as Preloader::HasManyThrough and + # call the +run+ method for each passed in class in the +records+ argument. + # # Not all records have the same class, so group then preload group on the reflection # itself so that if various subclass share the same association then we do not split # them unnecessarily -- GitLab