From 9e4558671c25f14950e21982ea93d5b977e9d2f8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 17 Mar 2008 04:02:34 +0000 Subject: Ensure that you can still do expressions in calculations (closes #11355) [nbugajski/cavelle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/cases/calculations_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 14987183eb..1771065a66 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -256,4 +256,8 @@ class CalculationsTest < ActiveRecord::TestCase def test_count_with_too_many_parameters_raises assert_raise(ArgumentError) { Account.count(1, 2, 3) } end + + def test_should_sum_expression + assert_equal "636", Account.sum("2 * credit_limit") + end end -- cgit v1.2.3