summaryrefslogtreecommitdiff
path: root/app/models/sent_notification.rb
diff options
context:
space:
mode:
authorAndriy Dyadyura <adyadyura@Andriys-MBP.lan>2016-01-14 15:54:15 +0100
committerAndriy Dyadyura <adyadyura@Andriys-MBP.lan>2016-01-14 15:54:15 +0100
commit3102575316e6eac937eb865346e0d78935c37362 (patch)
tree5434a52528390e18ac68ff705f19f8441a952f57 /app/models/sent_notification.rb
parente29ce9ac267e6724945b9558d069dda2b2ec2755 (diff)
parentb6ae2def2cb2b1da3ddcb3ceee556628a1147cc4 (diff)
downloadgitlab-ce-3102575316e6eac937eb865346e0d78935c37362.tar.gz
Diffstat (limited to 'app/models/sent_notification.rb')
-rw-r--r--app/models/sent_notification.rb12
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