From 8c736ceb2a3ba5b5584fd9f398665de32fc8745d Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sun, 10 Nov 2013 03:42:41 +0900 Subject: [PATCH] count + distinct: true won't work under AR 3.0 --- .../models/active_record/active_record_relation_methods_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/active_record/active_record_relation_methods_spec.rb b/spec/models/active_record/active_record_relation_methods_spec.rb index b53faea..5626937 100644 --- a/spec/models/active_record/active_record_relation_methods_spec.rb +++ b/spec/models/active_record/active_record_relation_methods_spec.rb @@ -51,7 +51,7 @@ if defined? ActiveRecord end end - if ActiveRecord::VERSION::STRING < '4.1.0' + if (ActiveRecord::VERSION::STRING >= '3.1.0') && (ActiveRecord::VERSION::STRING < '4.1.0') context 'when count receives options' do it 'should return a distinct set by column for rails < 4.1' do User.page(1).count(:name, :distinct => true).should == 4