diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-24 12:01:05 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-24 12:01:05 -0800 |
commit | f092ae544f58255508242a5308c456d9b8a13b0c (patch) | |
tree | a41093079fc4333bd5126e4158495452be24ba28 /lib/arel/table.rb | |
parent | 6667cfb995a49bffe66231a7ffc5a78ca7f5140f (diff) | |
download | rails-f092ae544f58255508242a5308c456d9b8a13b0c.tar.gz rails-f092ae544f58255508242a5308c456d9b8a13b0c.tar.bz2 rails-f092ae544f58255508242a5308c456d9b8a13b0c.zip |
make table aliases cheaper to allocate
Diffstat (limited to 'lib/arel/table.rb')
-rw-r--r-- | lib/arel/table.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb index fe12427d1b..6f29a02e56 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -34,8 +34,8 @@ module Arel end end - def alias - Nodes::TableAlias.new("#{name}_2", self).tap do |node| + def alias name = "#{self.name}_2" + Nodes::TableAlias.new(name, self).tap do |node| @aliases << node end end |