instance method
using_limitable_joins?
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
using_limitable_joins?()
Whether the joins of the relation itself keep it to one row per record, so that a limit can be applied to the query the eager load joins into.
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 527
def using_limitable_joins?
joins = classify_join_values(joins_values)
left_outer_joins = classify_join_values(left_outer_joins_values)
# A CTE is joined on the model's foreign key, so it can match many rows.
# It is not an association either, so it has no reflection to look at.
return false unless joins.cte_names.empty? && left_outer_joins.cte_names.empty?
using_limitable_reflections?(
construct_join_dependency(
joins.association_names + left_outer_joins.association_names, nil
).reflections
)
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 527
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods