Add prefix to reasons so that we can use reason_mentioned?

pull/9665/head
Oliver Günther 3 years ago
parent 208c8365eb
commit 3a76722cd2
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      app/helpers/mail_digest_helper.rb
  2. 3
      app/models/notification.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')

@ -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'

Loading…
Cancel
Save