Permalink
Browse files

pg does not allow aliases in the having clause, but functions are fine

  • Loading branch information...
tenderlove committed Aug 5, 2011
1 parent 04f88d1 commit 5a05207d99b7e2678f9b42db2d9ffc21ec2c8c3b
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/test/cases/calculations_test.rb
@@ -171,7 +171,7 @@ def test_should_group_by_summed_field_having_sanitized_condition
end
def test_should_group_by_summed_field_having_condition_from_select
- c = Account.select("MIN(credit_limit) AS min_credit_limit").group(:firm_id).having("min_credit_limit > 50").sum(:credit_limit)
+ c = Account.select("MIN(credit_limit) AS min_credit_limit").group(:firm_id).having("MIN(credit_limit) > 50").sum(:credit_limit)
assert_nil c[1]
assert_equal 60, c[2]
assert_equal 53, c[9]

0 comments on commit 5a05207

Please sign in to comment.