diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-09-13 14:06:17 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-09-13 14:06:17 -0400 |
commit | 44d2ef9623847dea5cbf6208ae7b5168b374c720 (patch) | |
tree | 3b596034f285a3ad8f77debeab373674bd7b83d4 /lib/arel | |
parent | 4e0ce3d6a5a6db0d59661733c65dff84b25c8384 (diff) | |
download | rails-44d2ef9623847dea5cbf6208ae7b5168b374c720.tar.gz rails-44d2ef9623847dea5cbf6208ae7b5168b374c720.tar.bz2 rails-44d2ef9623847dea5cbf6208ae7b5168b374c720.zip |
Don't store all aliases to a table
The aliases property of a table is never used other than for equality. However,
the aliases that have been created for a table aren't really something that
should affect whether a table is considered to be the same table or not. This
removal does not appear to have any affect within Active Record or within Arel.
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/table.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb index b4b4a861b8..0e7214f269 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -6,7 +6,7 @@ module Arel @engine = nil class << self; attr_accessor :engine; end - attr_accessor :name, :aliases, :table_alias + attr_accessor :name, :table_alias # TableAlias and Table both have a #table_name which is the name of the underlying table alias :table_name :name @@ -14,7 +14,6 @@ module Arel def initialize(name, as: nil, type_caster: nil) @name = name.to_s @columns = nil - @aliases = [] @type_caster = type_caster # Sometime AR sends an :as parameter to table, to let the table know @@ -27,9 +26,7 @@ module Arel end def alias name = "#{self.name}_2" - Nodes::TableAlias.new(self, name).tap do |node| - @aliases << node - end + Nodes::TableAlias.new(self, name) end def from @@ -94,7 +91,6 @@ module Arel def eql? other self.class == other.class && self.name == other.name && - self.aliases == other.aliases && self.table_alias == other.table_alias end alias :== :eql? |