diff options
author | Robert Speicher <robert@gitlab.com> | 2015-09-21 21:52:13 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-09-21 21:52:13 +0300 |
commit | d4a960161eecf5730b56d3f375573fa39aa67e95 (patch) | |
tree | 543dacf2fb1a37e77c4ae91cf935015e2d9f410f /app/models | |
parent | 534e548d4495e2193af6542ca8d62e7d5a3a223b (diff) | |
parent | 017219e7f548936ce348eeb445dc4717896902ec (diff) |
Merge branch 'rename-reply-by-email' into 'master'
Rename reply_by_email to incoming_email to prepare for the future.
Closes #2579.
See merge request !1367
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 03425389dd3..3eed5c16e45 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -25,6 +25,12 @@ class SentNotification < ActiveRecord::Base validates :line_code, format: { with: /\A[a-z0-9]+_\d+_\d+\Z/ }, allow_blank: true 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 |