Permalink
Browse files

In #apply_join_dependency, we can apply the #where in-place because r…

…elation is always a new object.

Thanks to the #except we call at the top of the method.
  • Loading branch information...
Empact committed May 10, 2013
1 parent 75fe743 commit 35c198ca9bc1ec530fc29b686978511f23cee076
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/finder_methods.rb
@@ -233,7 +233,7 @@ def apply_join_dependency(relation, join_dependency)
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

0 comments on commit 35c198c

Please sign in to comment.