aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2015-10-26 14:20:39 -0500
committerschneems <richard.schneeman@gmail.com>2015-10-26 18:07:34 -0500
commit6a25202d9ea3b4a7c9f2d6154b97cf8ba58403db (patch)
tree58a06d14438376f68295dc72eb06b2ccca7e8ebf
parentd81fbe22ed2e8f37e5bc4971fedf6ba9d3116655 (diff)
downloadrails-6a25202d9ea3b4a7c9f2d6154b97cf8ba58403db.tar.gz
rails-6a25202d9ea3b4a7c9f2d6154b97cf8ba58403db.tar.bz2
rails-6a25202d9ea3b4a7c9f2d6154b97cf8ba58403db.zip
[ci skip] Add doc for preloader_for
-rw-r--r--activerecord/lib/active_record/associations/preloader.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb
index fae955f815..ecf6fb8643 100644
--- a/activerecord/lib/active_record/associations/preloader.rb
+++ b/activerecord/lib/active_record/associations/preloader.rb
@@ -186,6 +186,10 @@ module ActiveRecord
def self.preloaded_records; []; end
end
+ # Returns a class containing the logic needed to load preload the data
+ # and attach it to a relation. For example +Preloader::Association+ or
+ # +Preloader::HasManyThrough+. The class returned implements a `run` method
+ # that accepts a preloader.
def preloader_for(reflection, owners, rhs_klass)
return NullPreloader unless rhs_klass