method
build_scope
v5.1.7 -
Show latest stable
- Class:
ActiveRecord::Associations::Preloader::Association
build_scope()private
No documentation available.
# File activerecord/lib/active_record/associations/preloader/association.rb, line 133
def build_scope
scope = klass.scope_for_association
if reflection.type
scope.where!(reflection.type => model.base_class.sti_name)
end
scope.merge!(reflection_scope)
scope.merge!(preload_scope) if preload_scope != NULL_RELATION
scope
end