diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index e0e04a0891..742c14b00e 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -1476,8 +1476,8 @@ class RelationTest < ActiveRecord::TestCase def test_having_with_binds_for_both_where_and_having post = Post.first - having_then_where = Post.having(id: post.id).where(title: post.title).group(:title) - where_then_having = Post.where(title: post.title).having(id: post.id).group(:title) + having_then_where = Post.having(id: post.id).where(title: post.title).group(:id) + where_then_having = Post.where(title: post.title).having(id: post.id).group(:id) assert_equal [post], having_then_where assert_equal [post], where_then_having @@ -1485,7 +1485,8 @@ class RelationTest < ActiveRecord::TestCase def test_multiple_where_and_having_clauses post = Post.first - having_then_where = Post.having(id: post.id).where(title: post.title).having(id: post.id).where(title: post.title).group(:title) + having_then_where = Post.having(id: post.id).where(title: post.title) + .having(id: post.id).where(title: post.title).group(:id) assert_equal [post], having_then_where end |