diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2013-05-10 17:34:51 +0200 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2013-05-10 17:46:04 +0200 |
commit | 35c198ca9bc1ec530fc29b686978511f23cee076 (patch) | |
tree | 58febd474fdd16c4367fb207ed905ae69d45b0c8 /activerecord/lib | |
parent | 75fe7434a81d0aaef8ec2ada8f88b5b20721c25a (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
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 |