From 437a9a2225008ce859b4485dd5808843f40f8a58 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 7 Sep 2010 16:45:25 -0700 Subject: count takes distinct --- spec/arel/attributes/attribute_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec') diff --git a/spec/arel/attributes/attribute_spec.rb b/spec/arel/attributes/attribute_spec.rb index f9eb56391e..d6f07f8d99 100644 --- a/spec/arel/attributes/attribute_spec.rb +++ b/spec/arel/attributes/attribute_spec.rb @@ -8,6 +8,13 @@ module Arel relation = Table.new(:users) relation[:id].count.should be_kind_of Nodes::Count end + + it 'should take a distinct param' do + relation = Table.new(:users) + count = relation[:id].count(nil) + count.should be_kind_of Nodes::Count + count.distinct.should be_nil + end end describe '#eq' do -- cgit v1.2.3