Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove notified_events usage in settings

Oliver Günther903e899c3bc0
diff --git a/db/migrate/20210802114054_add_notification_setting_options.rb b/db/migrate/20210802114054_add_notification_setting_options.rb
index 128c8640d1c..2e1a8d2e89c 100644
--- a/db/migrate/20210802114054_add_notification_setting_options.rb
+++ b/db/migrate/20210802114054_add_notification_setting_options.rb
@@ -1,7 +1,6 @@
class AddNotificationSettingOptions < ActiveRecord::Migration[6.1]
def change
add_notification_settings_options
- update_notified_events
end
def add_notification_settings_options
@@ -18,21 +17,4 @@ class AddNotificationSettingOptions < ActiveRecord::Migration[6.1]
t.index :all
end
end
-
- def update_notified_events
- event_types = %w(work_package_added work_package_updated work_package_note_added status_updated work_package_priority_updated)
-
- # rubocop:disable Rails/WhereExists
- # The Setting.exists? method is overwritten
- reversible do |dir|
- dir.up do
- Setting.notified_events = Setting.notified_events - event_types if Setting.where(name: 'notified_events').exists?
- end
-
- dir.down do
- Setting.notified_events = Setting.notified_events + event_types if Setting.where(name: 'notified_events').exists?
- end
- end
- # rubocop:enable Rails/WhereExists
- end
end