Skip to content

Commit a7860cc

Browse files
committed
[Rails5] Coerce HAVING queries.
1 parent 969c18f commit a7860cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/cases/coerced_tests.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ def test_limit_with_offset_is_kept_coerced
138138
assert_equal 1, queries.length
139139
queries.first.must_match %r{ORDER BY \[accounts\]\.\[id\] ASC OFFSET @0 ROWS FETCH NEXT @1 ROWS ONLY.*@0 = 1, @1 = 1}
140140
end
141-
end
142141

142+
# Leave it up to users to format selects/functions so HAVING works correctly.
143+
coerce_tests! :test_having_with_strong_parameters
144+
end
143145

144146

145147

@@ -585,6 +587,10 @@ def test_reverse_order_with_function_other_predicates_coerced
585587

586588
# We are not doing order duplicate removal anymore.
587589
coerce_tests! :test_default_scope_order_with_scope_order
590+
591+
# Leave it up to users to format selects/functions so HAVING works correctly.
592+
coerce_tests! :test_multiple_where_and_having_clauses
593+
coerce_tests! :test_having_with_binds_for_both_where_and_having
588594
end
589595

590596

0 commit comments

Comments
 (0)