Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add prefix to reasons so that we can use reason_mentioned?

Oliver Günther3a76722cd26d
diff --git a/app/helpers/mail_digest_helper.rb b/app/helpers/mail_digest_helper.rb
index 0f64fb1d968..af7ad9b6052 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 2502d3a83ad..b3d39d32fe9 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'