mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Whitelist adapters that support aliases in HAVING
clause
Support for using `SELECT` column or expression aliases in the `HAVING` clause isn't part of the SQL standard so it's better to whitelist the test for adapters where we know it works and skip it on others.
This commit is contained in:
parent
89d5d975e5
commit
3efad391e6
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ class CalculationsTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
def test_should_group_by_summed_field_having_condition_from_select
|
||||
skip if current_adapter?(:PostgreSQLAdapter, :OracleAdapter)
|
||||
skip unless current_adapter?(:Mysql2Adapter, :SQLite3Adapter)
|
||||
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]
|
||||
|
|
Loading…
Reference in a new issue