diff options
author | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-24 14:06:30 -0500 |
---|---|---|
committer | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-24 16:49:35 -0500 |
commit | 6928950def1bea9d564778e734822d4f5b8bac61 (patch) | |
tree | 36dfe89c9ce65ea9dfa11fc9cbed8e560da594bc /activerecord/lib/active_record/associations/association.rb | |
parent | 1280ad6d19fa56e9bf6d6a261c1231326cb3d8c3 (diff) | |
download | rails-6928950def1bea9d564778e734822d4f5b8bac61.tar.gz rails-6928950def1bea9d564778e734822d4f5b8bac61.tar.bz2 rails-6928950def1bea9d564778e734822d4f5b8bac61.zip |
Avoid passing unnecessary arguments to relation
Most of the time the table and predicate_builder
passed to Relation.new are exactly the
arel_table and predicate builder of the
given klass. This uses klass.arel_table
and klass.predicate_builder as the defaults,
so we don't have to pass them in most cases.
This does change the signaure of both Relation and
AssocationRelation. Are we ok with that?
Diffstat (limited to 'activerecord/lib/active_record/associations/association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index ca1f9f1650..7667c6ed8b 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -124,7 +124,7 @@ module ActiveRecord # Can be overridden (i.e. in ThroughAssociation) to merge in other scopes (i.e. the # through association's scope) def target_scope - AssociationRelation.create(klass, klass.arel_table, klass.predicate_builder, self).merge!(klass.all) + AssociationRelation.create(klass, self).merge!(klass.all) end def extensions |