Permalink
Browse files

Merge pull request #2829 from arunagw/pg_min_fix

pg does not allow aliases in the having clause, but functions are fine
  • Loading branch information...
2 parents e835aa0 + e7eba93 commit 66754c4666550cd7728b780edebae2e1633ffe93 @tenderlove tenderlove 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 66754c4

Please sign in to comment.