ruby - Rails: Is it possible to have temporary badges with Merit Gem -


i use merit gem create badges , points system on website. however, badges reset after each month. example, monthly badge of 20 comments. require users consistent on site. possible merit? know there "temporary" feature, resets badge based on if conditions no longer met, time-based way reset badges.

thank you!

sure:

grant_on 'comments#create', badge: 'frequent-commenter', to: :user, temporary: true |comment|   comment.user.comments.where(:created_at.gte => (date.today - 30)).count >= 20 end 

with code badge revoked if condition no longer holds


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -