Don't expose internal methods in Preloader::ThroughAssociation

`through_reflection` and `source_reflection` are used only in the class.
This commit is contained in:
Ryuta Kamizono 2017-11-08 20:08:19 +09:00
parent 3785e9aec7
commit 0c2cb880e3

@ -4,14 +4,6 @@ module ActiveRecord
module Associations
class Preloader
module ThroughAssociation #:nodoc:
def through_reflection
reflection.through_reflection
end
def source_reflection
reflection.source_reflection
end
def run(preloader)
already_loaded = owners.first.association(through_reflection.name).loaded?
through_scope = through_scope()
@ -48,6 +40,13 @@ def run(preloader)
end
private
def through_reflection
reflection.through_reflection
end
def source_reflection
reflection.source_reflection
end
def preload_index
@preload_index ||= @preloaded_records.each_with_object({}).with_index do |(id, result), index|