on deprecation/removal of the distinct option to Relation#count


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.

though as rafaelfranca pointed out, .count("DISTICT #{expr_str}") should work, there does not seem to be any compelling reason for breaking .count(expr_str, distinct: true)