diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-26 13:53:56 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-26 13:53:56 -0700 |
commit | 1d6bb77636aeec734079f63e1c14429b34e79ed9 (patch) | |
tree | 6e0f0930c1947d5f1d9ff1e95e12ca5992c25ff8 /activerecord/test/cases/relation | |
parent | ed1a775da3921797fc74d69bb392b2cc0ad57ef1 (diff) | |
download | rails-1d6bb77636aeec734079f63e1c14429b34e79ed9.tar.gz rails-1d6bb77636aeec734079f63e1c14429b34e79ed9.tar.bz2 rails-1d6bb77636aeec734079f63e1c14429b34e79ed9.zip |
Inject the `PredicateBuilder` into the `Relation` instance
Construction of relations can be a hotspot, we don't want to create one
of these in the constructor. This also allows us to do more expensive
things in the predicate builder's constructor, since it's created once
per AR::Base subclass
Diffstat (limited to 'activerecord/test/cases/relation')
-rw-r--r-- | activerecord/test/cases/relation/mutation_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation/mutation_test.rb b/activerecord/test/cases/relation/mutation_test.rb index 4c94c2fd0d..71abac35cc 100644 --- a/activerecord/test/cases/relation/mutation_test.rb +++ b/activerecord/test/cases/relation/mutation_test.rb @@ -25,7 +25,7 @@ module ActiveRecord end def relation - @relation ||= Relation.new FakeKlass.new('posts'), Post.arel_table + @relation ||= Relation.new FakeKlass.new('posts'), Post.arel_table, Post.predicate_builder end (Relation::MULTI_VALUE_METHODS - [:references, :extending, :order, :unscope, :select]).each do |method| |