From 519931ee4fdd0978847301e1bc6ec42260a995af Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 14 Dec 2014 15:48:10 +0100 Subject: [PATCH] fixed denotify --- app/models/notification.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index d5c0a3b1..d14f5ece 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -22,7 +22,8 @@ class Notification < ActiveRecord::Base notif_type = target.notification_type return nil unless notif_type - notif_type.find_by(recipient: recipient, target: target).destroy + notif = notif_type.find_by(recipient: recipient, target: target) + notif.destroy unless notif.nil? end private