From 7b8944cb7662509d7ba6869ff571518ac7f848ea Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 8 Sep 2010 14:36:10 -0700 Subject: adding a sum node --- lib/arel/attributes/attribute.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/arel/attributes') diff --git a/lib/arel/attributes/attribute.rb b/lib/arel/attributes/attribute.rb index 464d78188a..af9bbdd478 100644 --- a/lib/arel/attributes/attribute.rb +++ b/lib/arel/attributes/attribute.rb @@ -12,6 +12,10 @@ module Arel def count distinct = false Nodes::Count.new [self], distinct end + + def sum + Nodes::Sum.new [self], Nodes::SqlLiteral.new('sum_id') + end end class String < Attribute; end -- cgit v1.2.3