From f8f4ac91203506c94d547ee0ef530bd60faf97ed Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Mon, 25 Jun 2012 17:36:24 -0300 Subject: Ensure Arel columns are typecasted properly when grouping with calculation Fix build issue with postgresql. Conflicts: activerecord/lib/active_record/relation/calculations.rb activerecord/test/cases/calculations_test.rb --- activerecord/test/cases/calculations_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index e50de46f9e..cf1181e829 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -64,12 +64,16 @@ class CalculationsTest < ActiveRecord::TestCase def test_should_group_by_field c = Account.sum(:credit_limit, :group => :firm_id) - [1,6,2].each { |firm_id| assert c.keys.include?(firm_id) } + [1,6,2].each do |firm_id| + assert c.keys.include?(firm_id), "Group #{c.inspect} does not contain firm_id #{firm_id}" + end end def test_should_group_by_arel_attribute c = Account.sum(:credit_limit, :group => Account.arel_table[:firm_id]) - [1,6,2].each { |firm_id| assert c.keys.include?(firm_id) } + [1,6,2].each do |firm_id| + assert c.keys.include?(firm_id), "Group #{c.inspect} does not contain firm_id #{firm_id}" + end end def test_should_group_by_multiple_fields -- cgit v1.2.3