instance method
apply_join_dependency
Ruby on Rails 4.2.9
Since v3.0.20 PrivateSignature
apply_join_dependency(relation, join_dependency)
No documentation comment.
Parameters
-
relationreq -
join_dependencyreq
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 379
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!(table[primary_key].in(limited_ids))
end
relation.except(:limit, :offset)
end
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 379
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods