diff options
| author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-01-18 08:17:48 +0100 |
|---|---|---|
| committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-01-18 08:17:48 +0100 |
| commit | 3ecb3024a40882896632ff78789713a4552a19ab (patch) | |
| tree | e2a250e2434edde20f3e64431fc39d77a4d45977 /app/models/sent_notification.rb | |
| parent | 07f5a6f107529a932ca7d657a8473cba1afcba05 (diff) | |
| parent | 835f1961e65fe9b4f943b17747b1518c555e8bfd (diff) | |
| download | gitlab-ce-docs_refactor.tar.gz | |
Merge branch 'master' into docs_refactordocs_refactor
Diffstat (limited to 'app/models/sent_notification.rb')
| -rw-r--r-- | app/models/sent_notification.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index f36eda1531b..77115597d71 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -25,8 +25,6 @@ class SentNotification < ActiveRecord::Base class << self def reply_key - return nil unless Gitlab::IncomingEmail.enabled? - SecureRandom.hex(16) end @@ -59,11 +57,15 @@ class SentNotification < ActiveRecord::Base def record_note(note, recipient_id, reply_key, params = {}) params[:line_code] = note.line_code - + record(note.noteable, recipient_id, reply_key, params) end end + def unsubscribable? + !for_commit? + end + def for_commit? noteable_type == "Commit" end @@ -75,4 +77,8 @@ class SentNotification < ActiveRecord::Base super end end + + def to_param + self.reply_key + end end |
