method
apply_join_dependency
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::FinderMethods
apply_join_dependency(relation, join_dependency)private
No documentation available.
# File activerecord/lib/active_record/relation/finder_methods.rb, line 412
def apply_join_dependency(relation, join_dependency)
relation = relation.except(:includes, :eager_load, :preload)
relation = relation.joins join_dependency
if using_limitable_reflections?(join_dependency.reflections)
relation
else
if relation.limit_value
limited_ids = limited_ids_for(relation)
limited_ids.empty? ? relation.none! : relation.where!(primary_key => limited_ids)
end
relation.except(:limit, :offset)
end
end