diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-25 18:55:03 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-25 18:55:03 +0900 |
commit | ea37a5709b526c5e58ef5b96a27c62cf222a52c4 (patch) | |
tree | cf6bf3a7e4e986c7e2ed706be894bbe95977ca8b /activerecord/lib/active_record/associations | |
parent | d9ca57ab0b5c20af11f4b819e75306c668b203f7 (diff) | |
download | rails-ea37a5709b526c5e58ef5b96a27c62cf222a52c4.tar.gz rails-ea37a5709b526c5e58ef5b96a27c62cf222a52c4.tar.bz2 rails-ea37a5709b526c5e58ef5b96a27c62cf222a52c4.zip |
Remove useless `JoinInformation`
Since 213796f removed `binds`, `JoinInformation` only contain `joins`.
So it is enough to return `joins` simply.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 2c3d5b3429..dc029c08bd 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -174,9 +174,9 @@ module ActiveRecord def make_join_constraints(parent, child, join_type, aliasing = false) tables = aliasing ? table_aliases_for(parent, child) : child.tables - info = make_constraints(parent, child, tables, join_type) + joins = make_constraints(parent, child, tables, join_type) - [info] + child.children.flat_map { |c| make_join_constraints(child, c, join_type, aliasing) } + joins.concat child.children.flat_map { |c| make_join_constraints(child, c, join_type, aliasing) } end def table_aliases_for(parent, node) 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 30dbdb7fa5..a526468bf6 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -23,8 +23,6 @@ module ActiveRecord super && reflection == other.reflection end - JoinInformation = Struct.new :joins - def join_constraints(foreign_table, foreign_klass, join_type, tables, chain) joins = [] tables = tables.reverse @@ -51,7 +49,7 @@ module ActiveRecord foreign_table, foreign_klass = table, klass end - JoinInformation.new joins + joins end def table |