1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

In #apply_join_dependency, we can apply the #where in-place because relation is always a new object.

Thanks to the #except we call at the top of the method.
This commit is contained in:
Ben Woosley 2013-05-10 17:34:51 +02:00
parent 75fe7434a8
commit 35c198ca9b

View file

@ -233,7 +233,7 @@ module ActiveRecord
if using_limitable_reflections?(join_dependency.reflections)
relation
else
relation = relation.where(construct_limited_ids_condition(relation)) if relation.limit_value
relation.where!(construct_limited_ids_condition(relation)) if relation.limit_value
relation.except(:limit, :offset)
end
end