diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 16:45:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 16:45:25 -0700 |
commit | 437a9a2225008ce859b4485dd5808843f40f8a58 (patch) | |
tree | 1db7425fb6e8d24fcd1aea51ddf992fb6f923fb5 /spec/arel/attributes | |
parent | 5ab502a755d0031d229278b6f14123c45623dd04 (diff) | |
download | rails-437a9a2225008ce859b4485dd5808843f40f8a58.tar.gz rails-437a9a2225008ce859b4485dd5808843f40f8a58.tar.bz2 rails-437a9a2225008ce859b4485dd5808843f40f8a58.zip |
count takes distinct
Diffstat (limited to 'spec/arel/attributes')
-rw-r--r-- | spec/arel/attributes/attribute_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |