diff options
| author | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-09 13:58:31 +0000 |
|---|---|---|
| committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-09 13:58:31 +0000 |
| commit | 9fe93e3c3ad3f4896c91d5dde62e879c8d939be2 (patch) | |
| tree | c4b1fce33bd7dc2ea23caa0fcb48416b89ee5b08 /app | |
| parent | 8ed259b0829798698d074d41116ca6b15b436f0a (diff) | |
| parent | 3acbbb1ad93f43a44fa29081a1ccec4602048485 (diff) | |
| download | gitlab-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.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 |
