aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-07-15 11:29:09 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-07-15 11:29:09 +0900
commite9b18724cf6e791b22d940d81ff896b06c94b447 (patch)
treed087f725ac51a034ec9bd9d877fb3c4a36a873f9 /activerecord
parentc1f9fa8c69590222fac43d58bf64ef4a1225d7ce (diff)
downloadrails-e9b18724cf6e791b22d940d81ff896b06c94b447.tar.gz
rails-e9b18724cf6e791b22d940d81ff896b06c94b447.tar.bz2
rails-e9b18724cf6e791b22d940d81ff896b06c94b447.zip
Remove useless `aliased_table_name` in `JoinDependency`
If `table.table_alias` is not nil, it is enough to use `table` simply.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb6
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb4
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_base.rb4
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_part.rb5
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