From bee3bbdc05ed87b2226dc9a5b293bcf5789e8f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigur=C3=B0ur=20Gu=C3=B0brandsson?= Date: Thu, 26 Feb 2015 00:50:58 +0000 Subject: [PATCH] FIX: the badge triggers broke Needed to add self. for the badge trigger variables, otherwise it breaks everything ;) --- app/models/user_badge.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user_badge.rb b/app/models/user_badge.rb index b176f27b9..f78ed824b 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