FIX: the badge triggers broke
Needed to add self. for the badge trigger variables, otherwise it breaks everything ;)
This commit is contained in:
parent
15e54c715f
commit
bee3bbdc05
|
@ -12,12 +12,12 @@ class UserBadge < ActiveRecord::Base
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
Badge.increment_counter 'grant_count', self.badge_id
|
Badge.increment_counter 'grant_count', self.badge_id
|
||||||
DiscourseEvent.trigger(:user_badge_granted, badge_id, user_id)
|
DiscourseEvent.trigger(:user_badge_granted, self.badge_id, self.user_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
after_destroy do
|
after_destroy do
|
||||||
Badge.decrement_counter 'grant_count', self.badge_id
|
Badge.decrement_counter 'grant_count', self.badge_id
|
||||||
DiscourseEvent.trigger(:user_badge_removed, badge_id, user_id)
|
DiscourseEvent.trigger(:user_badge_removed, self.badge_id, self.user_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue