summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-10-09 13:58:31 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-10-09 13:58:31 +0000
commit9fe93e3c3ad3f4896c91d5dde62e879c8d939be2 (patch)
treec4b1fce33bd7dc2ea23caa0fcb48416b89ee5b08 /app
parent8ed259b0829798698d074d41116ca6b15b436f0a (diff)
parent3acbbb1ad93f43a44fa29081a1ccec4602048485 (diff)
downloadgitlab-ce-9fe93e3c3ad3f4896c91d5dde62e879c8d939be2.tar.gz
Merge branch '23888-fix-unsubscription-link-for-snippet-notification' into 'master'
Don't show an "Unsubscribe" link in snippet comment notifications Closes #23888 See merge request gitlab-org/gitlab-ce!14764
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