From f092ae544f58255508242a5308c456d9b8a13b0c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 24 Nov 2010 12:01:05 -0800 Subject: make table aliases cheaper to allocate --- lib/arel/nodes/table_alias.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/arel/nodes') diff --git a/lib/arel/nodes/table_alias.rb b/lib/arel/nodes/table_alias.rb index 7ec1fad272..60da7b19f3 100644 --- a/lib/arel/nodes/table_alias.rb +++ b/lib/arel/nodes/table_alias.rb @@ -1,20 +1,16 @@ module Arel module Nodes class TableAlias - attr_reader :name, :relation, :columns + attr_reader :name, :relation alias :table_alias :name def initialize name, relation @name = name @relation = relation - @columns = relation.columns.map { |column| - column.dup.tap { |col| col.relation = self } - } end def [] name - name = name.to_sym - columns.find { |column| column.name == name } + Attribute.new self, name end end end -- cgit v1.2.3