diff options
Diffstat (limited to 'app/models/notification_setting.rb')
-rw-r--r-- | app/models/notification_setting.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb index c8c1f47c182..c003a20f0fc 100644 --- a/app/models/notification_setting.rb +++ b/app/models/notification_setting.rb @@ -46,7 +46,8 @@ class NotificationSetting < ApplicationRecord :merge_merge_request, :failed_pipeline, :fixed_pipeline, - :success_pipeline + :success_pipeline, + :moved_project ].freeze # Update unfound_translations.rb when events are changed @@ -96,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 |