aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2013-05-10 17:34:51 +0200
committerBen Woosley <ben.woosley@gmail.com>2013-05-10 17:46:04 +0200
commit35c198ca9bc1ec530fc29b686978511f23cee076 (patch)
tree58febd474fdd16c4367fb207ed905ae69d45b0c8 /activerecord/lib/active_record
parent75fe7434a81d0aaef8ec2ada8f88b5b20721c25a (diff)
downloadrails-35c198ca9bc1ec530fc29b686978511f23cee076.tar.gz
rails-35c198ca9bc1ec530fc29b686978511f23cee076.tar.bz2
rails-35c198ca9bc1ec530fc29b686978511f23cee076.zip
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.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb2
1 files changed, 1 insertions, 1 deletions
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