diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-25 17:36:24 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-25 18:35:53 -0300 |
commit | f8f4ac91203506c94d547ee0ef530bd60faf97ed (patch) | |
tree | a19da39a9d3add46aad8ca3f0ff8d807d2676ad2 /activerecord/test/cases | |
parent | 12ac97707997f11ebda9d7527aaff14d079a2460 (diff) | |
download | rails-f8f4ac91203506c94d547ee0ef530bd60faf97ed.tar.gz rails-f8f4ac91203506c94d547ee0ef530bd60faf97ed.tar.bz2 rails-f8f4ac91203506c94d547ee0ef530bd60faf97ed.zip |
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
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |