From d4abd35feb84db37815ecd8f0b37f657317105c1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 12 Sep 2010 18:15:21 -0700 Subject: using table_alias when :as is passed to the constructor --- lib/arel/visitors/to_sql.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/arel/visitors') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index be9a62325a..391d2ff1c4 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -139,7 +139,11 @@ module Arel end def visit_Arel_Table o - quote_table_name o.name + if o.table_alias + "#{quote_table_name o.name} #{quote_table_name o.table_alias}" + else + quote_table_name o.name + end end def visit_Arel_Nodes_In o -- cgit v1.2.3