All,
I created a pull request that adds Enumerable#count_by, which leverages Enumerable#group_by to return the counts elements rather than arrays of the elements.
https://github.com/rails/rails/pull/1932
It’s a convenience method I’ve used for some time, mainly for debugging and logging, that I think belongs in core ActiveSupport with the other Enumerable additions. I’d appreciate feedback from the community on whether you agree on its usefulness, as well as the quality of the code, documentation, and tests.
Thanks,
Patrick