-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag counter in parent model #8
Comments
I think this is a similar issue as #10 if I understand correctly. Can you elaborate a bit more on what you are trying to accomplish? Specifically, what kind of data are you trying to aggregate? per user, per model, and per context tagging? |
some sort of tagger functionality? |
If I understand correctly think the I'm thinking about how best to represent the taggable, tagger, and tags in mongo db. Will probably implement something pretty soon. |
Sorry for my late reply! I want to be able to store the weight of tags in another model. I created a solution based on your gem to solve this, but I think the aggregation is way to costly in my implementation. I also added support to add more meta then just the counter. Perhaps you want to take a look at it: https://github.com/christianhager/mongoid_tag Its not a good idea to create a gem that is almost a copy of yours, but I wanted to learn how to make a gem as well. |
Code cleanup + Mongoid options pass-thru
Hi, thanks for this great tool! A true time-saver. I was also looking for a way to scope the tag-counter into some parent model.
In addition to
Account.tags_with_weight
I want to do
current_account.tags_with_weight
I came up with this
Then in the taggable model you can do this:
What do you think about the idea? I would gladly push some code, but had some trouble getting the specs to run as it needs mongo 1.8. I will try to get that sorted out, but would love to hear your thoughts on the idea first.
The text was updated successfully, but these errors were encountered: