diff --git a/app/models/user_badge.rb b/app/models/user_badge.rb index b176f27b9d0..f78ed824bb0 100644 --- a/app/models/user_badge.rb +++ b/app/models/user_badge.rb @@ -12,12 +12,12 @@ class UserBadge < ActiveRecord::Base after_create do 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 after_destroy do 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