[DEPRACATION] default scope uses block instead of lambda
[DEPRECATION] change count(distinct: true) to distinct.count