From 3a76722cd26d64035f45aad48f2e1b54320bc87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 28 Sep 2021 20:15:39 +0200 Subject: [PATCH] Add prefix to reasons so that we can use reason_mentioned? --- app/helpers/mail_digest_helper.rb | 2 +- app/models/notification.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/mail_digest_helper.rb b/app/helpers/mail_digest_helper.rb index 0f64fb1d96..af7ad9b605 100644 --- a/app/helpers/mail_digest_helper.rb +++ b/app/helpers/mail_digest_helper.rb @@ -52,7 +52,7 @@ module MailDigestHelper end def digest_comment_text(notification) - if notification.reason == "mentioned" + if notification.reason_mentioned? sanitize I18n.t(:'mail.digests.work_packages.mentioned') else sanitize I18n.t(:'mail.digests.work_packages.comment_added') diff --git a/app/models/notification.rb b/app/models/notification.rb index 2502d3a83a..b3d39d32fe 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -12,7 +12,8 @@ class Notification < ApplicationRecord responsible: 9 }.freeze - enum reason: REASONS + enum reason: REASONS, + _prefix: true belongs_to :recipient, class_name: 'User' belongs_to :actor, class_name: 'User'