From a56518aee2258472f5f80807d733ccfa63eedb2d Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 30 Dec 2009 10:41:30 +0530 Subject: [PATCH] Fix the count test for postgres --- activerecord/test/cases/relations_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index f0ef3e22c5..7b5ff246c0 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -418,7 +418,7 @@ class RelationTest < ActiveRecord::TestCase Post.update_all(:comments_count => nil) posts = Post.scoped - assert_equal 0, posts.select('comments_count').where('id is not null').order('id').count + assert_equal [0], posts.select('comments_count').where('id is not null').group('id').order('id').count.values.uniq assert_equal 0, posts.where('id is not null').select('comments_count').count assert_equal 7, posts.select('comments_count').count('id')