From 301dfa5a3888a41ea36324a390241538249e9a53 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 8 Sep 2010 14:54:44 -0700 Subject: as is implemented --- lib/arel/nodes/sum.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/arel/nodes/sum.rb b/lib/arel/nodes/sum.rb index ecd66aba7a..d81455fa5f 100644 --- a/lib/arel/nodes/sum.rb +++ b/lib/arel/nodes/sum.rb @@ -7,6 +7,16 @@ module Arel @expressions = expr @alias = aliaz end + + def as aliaz + self.alias = SqlLiteral.new(aliaz) + self + end + + def to_sql + viz = Visitors::ToSql.new Table.engine + viz.accept self + end end end end -- cgit v1.2.3