From 6a25202d9ea3b4a7c9f2d6154b97cf8ba58403db Mon Sep 17 00:00:00 2001 From: schneems Date: Mon, 26 Oct 2015 14:20:39 -0500 Subject: [PATCH] [ci skip] Add doc for preloader_for --- activerecord/lib/active_record/associations/preloader.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 @@ def self.run(preloader); end 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 -- GitLab