diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/sent_notification.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index 33b113a2a27..2724af8e613 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -23,6 +23,12 @@ class SentNotification < ActiveRecord::Base validates :commit_id, presence: true, if: :for_commit? class << self + def reply_key + return nil unless Gitlab::IncomingEmail.enabled? + + SecureRandom.hex(16) + end + def for(reply_key) find_by(reply_key: reply_key) end |