diff options
Diffstat (limited to 'app/models/notification_recipient.rb')
-rw-r--r-- | app/models/notification_recipient.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/models/notification_recipient.rb b/app/models/notification_recipient.rb index 36b7cd64c73..6a6b2bb1b58 100644 --- a/app/models/notification_recipient.rb +++ b/app/models/notification_recipient.rb @@ -52,10 +52,9 @@ class NotificationRecipient when :mention @type == :mention when :participating - %i[failed_pipeline fixed_pipeline].include?(@custom_action) || - %i[participating mention].include?(@type) + participating_custom_action? || participating_or_mention? when :custom - custom_enabled? || %i[participating mention].include?(@type) + custom_enabled? || participating_or_mention? when :watch !excluded_watcher_action? else @@ -175,4 +174,12 @@ class NotificationRecipient .where.not(level: NotificationSetting.levels[:global]) .first end + + def participating_custom_action? + %i[failed_pipeline fixed_pipeline moved_project].include?(@custom_action) + end + + def participating_or_mention? + %i[participating mention].include?(@type) + end end |