-
Notifications
You must be signed in to change notification settings - Fork 11
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
score? #5
Comments
@chovy You could get that number now by This would allow you to weight those values any way you like. |
Yeah, i started thinking last night, its more flexible by providing the arrays you do provides. Allows you to customize the display of a count in whatever way you want. |
An option to include score would be really helpful, it would permit query.sort ('-score') which I think means sort from top voted. If you don't feel like it is a good fit, do you have any suggestions for implementation? I think I would like it to be updated on each .upvote() or .downvote(). Thanks for your work so far! |
Hi @johnstonmatt. You could also have a pre save hook and do any transformation for the .score property on your model. You may as well define it the way you prefer as long as it's not attached to the plugin. I was thinking on maybe supporting a function transformation at the config level for that. But it would end doing the same thing. Let me know if that works fine. |
A pre save hook sounds like exactly what I want, I'll try to implement that myself. Thanks for your help, and for sharing your work. If I make any interesting optimizations or discoveries in my implementation I will share them. |
Sure, thanks! Any PR would be reviewed and very welcome! 😀 |
I think that |
Please merge #9 |
@raistlinthewiz will take a look tonight. |
is there a way to tell the score?
Like if a post has 3 downvotes and 1 upvote the "score" would be -2.
The text was updated successfully, but these errors were encountered: