diff options
author | Rémy Coutable <remy@rymai.me> | 2017-10-09 14:59:10 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-10-09 15:03:05 +0200 |
commit | 3acbbb1ad93f43a44fa29081a1ccec4602048485 (patch) | |
tree | a0870f97967f5fd0e55aaa13caf99067db660e21 /app/models/sent_notification.rb | |
parent | f277fa14094e5515e2317d2baa1fa0bfb95966da (diff) | |
download | gitlab-ce-3acbbb1ad93f43a44fa29081a1ccec4602048485.tar.gz |
Don't show an "Unsubscribe" link in snippet comment notifications
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/sent_notification.rb')
-rw-r--r-- | app/models/sent_notification.rb | 6 |
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 |