summaryrefslogtreecommitdiff
path: root/app/models/notification_recipient.rb
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-06-05 15:37:08 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-06-06 01:34:25 +0800
commita1684d1440c7a875ded0d8616e83932aa64f7b4d (patch)
tree1ec66a9928f2b01e8b6229a8ac4ccb7182f0e651 /app/models/notification_recipient.rb
parentf7ec4df5f07335730018e67ce4ef23560d7225b6 (diff)
downloadgitlab-ce-a1684d1440c7a875ded0d8616e83932aa64f7b4d.tar.gz
Simplify notification check for participatingsimplify-pipeline-notification-check
Diffstat (limited to 'app/models/notification_recipient.rb')
-rw-r--r--app/models/notification_recipient.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/models/notification_recipient.rb b/app/models/notification_recipient.rb
index 6f057f79ef6..9b2bbb7eba5 100644
--- a/app/models/notification_recipient.rb
+++ b/app/models/notification_recipient.rb
@@ -50,7 +50,7 @@ class NotificationRecipient
when :mention
@type == :mention
when :participating
- !excluded_participating_action? && %i[participating mention watch].include?(@type)
+ @custom_action == :failed_pipeline || %i[participating mention].include?(@type)
when :custom
custom_enabled? || %i[participating mention].include?(@type)
when :watch
@@ -106,12 +106,6 @@ class NotificationRecipient
NotificationSetting::EXCLUDED_WATCHER_EVENTS.include?(@custom_action)
end
- def excluded_participating_action?
- return false unless @custom_action
-
- NotificationSetting::EXCLUDED_PARTICIPATING_EVENTS.include?(@custom_action)
- end
-
private
def read_ability