From 8411d1cffc05171e82d727d883f03e279c8e9e05 Mon Sep 17 00:00:00 2001 From: Mark Chao Date: Mon, 23 Jul 2018 10:42:19 +0800 Subject: Add email_events to replace EMAIL_EVENTS because it needs to be dynamic, allowing override for EE. --- lib/api/notification_settings.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api/notification_settings.rb') diff --git a/lib/api/notification_settings.rb b/lib/api/notification_settings.rb index 0266bf2f717..9c824d9953c 100644 --- a/lib/api/notification_settings.rb +++ b/lib/api/notification_settings.rb @@ -23,7 +23,7 @@ module API params do optional :level, type: String, desc: 'The global notification level' optional :notification_email, type: String, desc: 'The email address to send notifications' - NotificationSetting::EMAIL_EVENTS.each do |event| + NotificationSetting.email_events.each do |event| optional event, type: Boolean, desc: 'Enable/disable this notification' end end @@ -73,7 +73,7 @@ module API end params do optional :level, type: String, desc: "The #{source_type} notification level" - NotificationSetting::EMAIL_EVENTS.each do |event| + NotificationSetting.email_events(source_type.to_sym).each do |event| optional event, type: Boolean, desc: 'Enable/disable this notification' end end -- cgit v1.2.1