From 35c198ca9bc1ec530fc29b686978511f23cee076 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Fri, 10 May 2013 17:34:51 +0200 Subject: [PATCH] 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. --- activerecord/lib/active_record/relation/finder_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index d2cc2c7d88..332548ea3e 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -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