From 5d11fa9f6a850ac4374a01e402740ca8a7b50f32 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 Sep 2010 15:17:09 -0700 Subject: [PATCH] adding sum to sql literal --- lib/arel/nodes/sql_literal.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/arel/nodes/sql_literal.rb b/lib/arel/nodes/sql_literal.rb index 6471469d9f..7299fb1d45 100644 --- a/lib/arel/nodes/sql_literal.rb +++ b/lib/arel/nodes/sql_literal.rb @@ -5,6 +5,10 @@ module Arel Count.new [self], distinct end + def sum + Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id') + end + def maximum Nodes::Max.new [self], Nodes::SqlLiteral.new('max_id') end