Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-10-09 15:59:10 +0300
committerRémy Coutable <remy@rymai.me>2017-10-09 16:03:05 +0300
commit3acbbb1ad93f43a44fa29081a1ccec4602048485 (patch)
treea0870f97967f5fd0e55aaa13caf99067db660e21 /app
parentf277fa14094e5515e2317d2baa1fa0bfb95966da (diff)
Don't show an "Unsubscribe" link in snippet comment notifications
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app')
-rw-r--r--app/models/sent_notification.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb
index 298569cb7a6..6e311806be1 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -53,13 +53,17 @@ class SentNotification < ActiveRecord::Base
end
def unsubscribable?
- !for_commit?
+ !(for_commit? || for_snippet?)
end
def for_commit?
noteable_type == "Commit"
end
+ def for_snippet?
+ noteable_type.end_with?('Snippet')
+ end
+
def noteable
if for_commit?
project.commit(commit_id) rescue nil