mongoid-tags-arent-hard
mongoid-tags-arent-hard copied to clipboard
Add #all_tags_counts method that returns distinct tag names and their usage count
This should return an array of arrays of the form:
[ ['tag_name_1',12], ['tag name 2', 1], [...] ]
It should work within scoped queries
Foo.all_tags_counts
Foo.where(name: 'test').all_tags_counts
Foo.all_colors_counts
Foo.where(name: 'test').all_colors_counts
...and mabye there's a better name for this method?
...just revised the issue description so that it better conforms to the tag naming convention.
I'll happily accept a pull request for this.