diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-17 15:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-17 15:10:12 +0300 |
commit | 4203215d542505bba491a01d637479934c8005d6 (patch) | |
tree | 000a956ac60247021ff8c36a1a17a1ea6ed1ff38 /app/models/notification_setting.rb | |
parent | 325318e2ddfcaedf0527053dd3c9bd62db547089 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/notification_setting.rb')
-rw-r--r-- | app/models/notification_setting.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb index f4b6b40a11f..c003a20f0fc 100644 --- a/app/models/notification_setting.rb +++ b/app/models/notification_setting.rb @@ -97,7 +97,11 @@ class NotificationSetting < ApplicationRecord alias_method :fixed_pipeline?, :fixed_pipeline def event_enabled?(event) - respond_to?(event) && !!public_send(event) # rubocop:disable GitlabSecurity/PublicSend + # We override these two attributes, so we can't use read_attribute + return failed_pipeline if event.to_sym == :failed_pipeline + return fixed_pipeline if event.to_sym == :fixed_pipeline + + has_attribute?(event) && !!read_attribute(event) end def owns_notification_email |