https://github.com/rails/rails/pull/9683#issuecomment-22827535

when distinct is intended as a parameter of the sql count function 
(COUNT(DISTINCT DATE(attr))), it makes perfect sense for it to be a 
parameter to the count method, particularly when you are counting 
expressions.

When counting just records (*) and count takes no arguments, 
`.distinct.count` reads ok, but when there's an expression involved 
`.count('date(attr)')`, distinct and the count expression belong together 
as arguments to count `.count('date(attr)', distinct: true)`, as in SQL 
`COUNT(DISTINCT DATE(attr)`

I think counting with expressions is sufficient reason for :distinct param 
to remain.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to