Permalink
Browse files

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

  • Loading branch information...
1 parent e7ee2a9 commit e7eba93d82eae3d32dc63caa93896a9196e967f0 @arunagw arunagw committed Sep 3, 2011
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 e7eba93

Please sign in to comment.