diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2017-03-03 14:47:13 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2017-03-03 14:47:13 -0800 |
commit | a5533028e11bb21486aa2a8efbe2a0b3007f7711 (patch) | |
tree | 13aa31520f50195c9bdcd99307028c34cab7868b /activerecord/lib/active_record/associations | |
parent | 4be42720e416ceb0ed7c685b311fe91b17d4c93f (diff) | |
download | rails-a5533028e11bb21486aa2a8efbe2a0b3007f7711.tar.gz rails-a5533028e11bb21486aa2a8efbe2a0b3007f7711.tar.bz2 rails-a5533028e11bb21486aa2a8efbe2a0b3007f7711.zip |
`join_keys` no longer needs a class passed to it
Reflections only use their own information to create a `join_keys`
object. This means that we can call `join_keys` on a reflection object
and have it be context-free.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_scope.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index badde9973f..0e769b5fb5 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -61,7 +61,7 @@ module ActiveRecord end def last_chain_scope(scope, table, reflection, owner, association_klass) - join_keys = reflection.join_keys(association_klass) + join_keys = reflection.join_keys key = join_keys.key foreign_key = join_keys.foreign_key @@ -81,7 +81,7 @@ module ActiveRecord end def next_chain_scope(scope, table, reflection, association_klass, foreign_table, next_reflection) - join_keys = reflection.join_keys(association_klass) + join_keys = reflection.join_keys key = join_keys.key foreign_key = join_keys.foreign_key diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index 17670ebc0c..97cfec0302 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -34,7 +34,7 @@ module ActiveRecord table = tables.shift klass = reflection.klass - join_keys = reflection.join_keys(klass) + join_keys = reflection.join_keys key = join_keys.key foreign_key = join_keys.foreign_key |