mongoid-tags-arent-hard icon indicating copy to clipboard operation
mongoid-tags-arent-hard copied to clipboard

Add #all_tags_counts method that returns distinct tag names and their usage count

Open cblock opened this issue 12 years ago • 2 comments

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?

cblock avatar Nov 25 '12 11:11 cblock

...just revised the issue description so that it better conforms to the tag naming convention.

cblock avatar Nov 25 '12 12:11 cblock

I'll happily accept a pull request for this.

markbates avatar Nov 25 '12 13:11 markbates