We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c03e17 commit 0fac455Copy full SHA for 0fac455
activerecord/test/cases/relation/or_test.rb
@@ -95,9 +95,9 @@ def test_or_with_incompatible_unscope
95
end
96
97
def test_or_when_grouping
98
- groups = Post.where("id < 10").group("body").select("body, COUNT(*) AS c")
99
- expected = groups.having("COUNT(*) > 1 OR body like 'Such%'").to_a.map { |o| [o.body, o.c] }
100
- assert_equal expected, groups.having("COUNT(*) > 1").or(groups.having("body like 'Such%'")).to_a.map { |o| [o.body, o.c] }
+ groups = Post.where("id < 10").group("body")
+ expected = groups.having("COUNT(*) > 1 OR body like 'Such%'").count
+ assert_equal expected, groups.having("COUNT(*) > 1").or(groups.having("body like 'Such%'")).count
101
102
103
def test_or_with_named_scope
0 commit comments