diff options
Diffstat (limited to 'lib/arel/engines/sql/formatters.rb')
-rw-r--r-- | lib/arel/engines/sql/formatters.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/arel/engines/sql/formatters.rb b/lib/arel/engines/sql/formatters.rb index 892f0c29ee..cdbda5ea33 100644 --- a/lib/arel/engines/sql/formatters.rb +++ b/lib/arel/engines/sql/formatters.rb @@ -93,7 +93,7 @@ module Arel class TableReference < Formatter def select(select_sql, table) - "(#{select_sql})#{as_keyword}#{quote_table_name(name_for(table))}" + "(#{select_sql}) #{quote_table_name(name_for(table))}" end def table(table) @@ -101,16 +101,9 @@ module Arel table.name else quote_table_name(table.name) + - (table.name != name_for(table) ? as_keyword + quote_table_name(name_for(table)) : '') + (table.name != name_for(table) ? " #{quote_table_name(name_for(table))}" : '') end end - - private - - def as_keyword - # AS keyword should not be used before table alias in Oracle - as_keyword = engine.adapter_name == "Oracle" ? " " : " AS " - end end class Attribute < WhereCondition |