summaryrefslogtreecommitdiff
path: root/app/models/notification_setting.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /app/models/notification_setting.rb
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
downloadgitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/models/notification_setting.rb')
-rw-r--r--app/models/notification_setting.rb9
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