diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-07-15 14:53:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-15 14:53:40 +0200 |
commit | ca9ac253c7023662e60bbe8b4e6c0d4f42ac4497 (patch) | |
tree | 4c5d26832e1ee75a545e627a1257d0567506d4fd /activerecord/lib/active_record | |
parent | 78e05747f2282951e9717144869b17b7413df164 (diff) | |
parent | e9b18724cf6e791b22d940d81ff896b06c94b447 (diff) | |
download | rails-ca9ac253c7023662e60bbe8b4e6c0d4f42ac4497.tar.gz rails-ca9ac253c7023662e60bbe8b4e6c0d4f42ac4497.tar.bz2 rails-ca9ac253c7023662e60bbe8b4e6c0d4f42ac4497.zip |
Merge pull request #29798 from kamipo/remove_useless_aliased_table_name
Remove useless `aliased_table_name` in `JoinDependency`
Diffstat (limited to 'activerecord/lib/active_record')
4 files changed, 1 insertions, 18 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 04cdcb6a7f..5c8ecf42b4 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -33,12 +33,8 @@ module ActiveRecord end Table = Struct.new(:node, :columns) do # :nodoc: - def table - Arel::Nodes::TableAlias.new node.table, node.aliased_table_name - end - def column_aliases - t = table + t = node.table columns.map { |column| t[column.name].as Arel.sql column.alias } end end 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 b14ddfeeeb..98b2f40357 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -57,10 +57,6 @@ module ActiveRecord def table tables.first end - - def aliased_table_name - table.table_alias || table.name - end end end end diff --git a/activerecord/lib/active_record/associations/join_dependency/join_base.rb b/activerecord/lib/active_record/associations/join_dependency/join_base.rb index 6e0963425d..f5f22ebfca 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_base.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_base.rb @@ -12,10 +12,6 @@ module ActiveRecord def table base_klass.arel_table end - - def aliased_table_name - base_klass.table_name - end end end end diff --git a/activerecord/lib/active_record/associations/join_dependency/join_part.rb b/activerecord/lib/active_record/associations/join_dependency/join_part.rb index 80c9fde5d1..5666e069fc 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_part.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_part.rb @@ -36,11 +36,6 @@ module ActiveRecord raise NotImplementedError end - # The alias for the active_record's table - def aliased_table_name - raise NotImplementedError - end - def extract_record(row, column_names_with_alias) # This code is performance critical as it is called per row. # see: https://github.com/rails/rails/pull/12185 |