diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 18:09:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 18:09:21 +0000 |
commit | e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch) | |
tree | 9abb3c0706576bbda895fe9539a55556930606e2 /app/models/notification_setting.rb | |
parent | f8d15ca65390475e356b06dedc51e10ccd179f86 (diff) | |
download | gitlab-ce-e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/notification_setting.rb')
-rw-r--r-- | app/models/notification_setting.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb index e2c362538eb..38bd95e6a20 100644 --- a/app/models/notification_setting.rb +++ b/app/models/notification_setting.rb @@ -44,6 +44,7 @@ class NotificationSetting < ApplicationRecord :reassign_merge_request, :merge_merge_request, :failed_pipeline, + :fixed_pipeline, :success_pipeline ].freeze @@ -76,9 +77,9 @@ class NotificationSetting < ApplicationRecord setting end - # Allow people to receive failed pipeline notifications if they already have - # custom notifications enabled, as these are more like mentions than the other - # custom settings. + # Allow people to receive both failed pipeline/fixed pipeline notifications + # if they already have custom notifications enabled, + # as these are more like mentions than the other custom settings. def failed_pipeline bool = super @@ -86,6 +87,13 @@ class NotificationSetting < ApplicationRecord end alias_method :failed_pipeline?, :failed_pipeline + def fixed_pipeline + bool = super + + bool.nil? || bool + end + alias_method :fixed_pipeline?, :fixed_pipeline + def event_enabled?(event) respond_to?(event) && !!public_send(event) # rubocop:disable GitlabSecurity/PublicSend end |