Вопрос

There's a cool library I found for voting on things -> https://github.com/brady8/thumbs_up

I'd like to be able to modify it myself or with someone's help to add weight based on time. Business logic wise, I have an idea of how to do it, but could use some guidance on how to implement it.

My reasoning for this is that unless you add weight based on time, then old entries with the most votes will always be at the top of a tally query. It makes sense to have newer entries have more weight so they have the ability to surface.

Thoughts? Perhaps there's a library that already does this?

Это было полезно?

Решение

Most sites now categorize by time period, such as "Top today", "Top this week" and "All Time"

That way, you can still be fair about it and so people can still see what content has held it's spot at the top over time.

It looks like that gem already supports time periods, so you'd really be on your way, I think

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top