Just got a precious jewel and works with my rail 4 application.
Until now, the user receives the first icon when creating a subparticle.
The second icon that I am trying to award is when this sub-article is actually approved, which can only be done by the administrator. I tried to use it subarticle#updateas an action, but it does not award the user with an icon. Perhaps this is due to the fact that the administrator updates the subarticle from the admin panel (rails admin gem)?
Here is my initializer icon:
Merit::Badge.create!(
id: 2,
name: "Serious Writer",
description: "Things are gettin' serious! You have successfully written an approved article."
)
and here are the rules:
grant_on ['subarticles#update','subarticles#destroy'], badge_id: 2, badge:'serious writer', to: :user, temporary: true do |subarticle|
subarticle.user.subarticles.approved.count >= 1
end
Any suggestions? Still new to this jewel, so maybe this is a simple mistake.
source
share