This method is deprecated or moved on the latest stable version.
The last existing version (v6.1.7.7) is shown here.
preloader_for(reflection, owners)
private
Returns a class containing the logic needed to load preload the
data and attach it to a relation. The class returned implements a `run`
method that accepts a preloader.
# File activerecord/lib/active_record/associations/preloader.rb, line 192
def preloader_for(reflection, owners)
if owners.all? { |o| o.association(reflection.name).loaded? }
return AlreadyLoaded
end
reflection.check_preloadable!
if reflection.options[:through]
ThroughAssociation
else
Association
end
end