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