From 1aecf8b41ca3f238cb41c03902dacc8a5e3039f4 Mon Sep 17 00:00:00 2001 From: Carson Reinke Date: Thu, 23 Jul 2015 09:55:59 -0400 Subject: Add OrderPredications back into Nodes::Function (removed with deprecation of Expression) --- test/nodes/test_sum.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/nodes') diff --git a/test/nodes/test_sum.rb b/test/nodes/test_sum.rb index d65cd31d4b..d387e7f9ef 100644 --- a/test/nodes/test_sum.rb +++ b/test/nodes/test_sum.rb @@ -21,4 +21,13 @@ describe Arel::Nodes::Sum do assert_equal 2, array.uniq.size end end + + describe 'order' do + it 'should order the sum' do + table = Arel::Table.new :users + table[:id].sum.desc.to_sql.must_be_like %{ + SUM("users"."id") DESC + } + end + end end -- cgit v1.2.3