diff options
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index f45bbab793..ada8aa6a16 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -69,6 +69,11 @@ module Arel }.join(', ')})#{o.alias ? " AS #{visit o.alias}" : ''}" end + def visit_Arel_Nodes_Sum o + "SUM(#{o.expressions.map { |x| + visit x }.join(', ')})#{o.alias ? " AS #{visit o.alias}" : ''}" + end + def visit_Arel_Nodes_TableAlias o "#{visit o.relation} #{quote_table_name o.name}" end |