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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Set shared notification setting to true by default
Oliver Günther9ffe49d971b5
diff --git a/db/migrate/20240611105232_set_watched_notification_setting_to_true.rb b/db/migrate/20240611105232_set_watched_notification_setting_to_true.rbnew file mode 100644index 00000000000..b2b851852d6--- /dev/null+++ b/db/migrate/20240611105232_set_watched_notification_setting_to_true.rb@@ -0,0 +1,15 @@+class SetWatchedNotificationSettingToTrue < ActiveRecord::Migration[7.1]+ def change+ change_column_default :notification_settings, :shared, from: false, to: true++ reversible do |dir|+ dir.up do+ execute "UPDATE notification_settings SET shared = true"+ end++ dir.down do+ execute "UPDATE notification_settings SET shared = false"+ end+ end+ end+enddiff --git a/spec/services/user_preferences/update_service_integration_spec.rb b/spec/services/user_preferences/update_service_integration_spec.rbindex e7b2ec3b027..8d4e922667a 100644--- a/spec/services/user_preferences/update_service_integration_spec.rb+++ b/spec/services/user_preferences/update_service_integration_spec.rb@@ -126,7 +126,8 @@ RSpec.describe UserPreferences::UpdateService, "integration", type: :model doNotificationSetting::OVERDUE => nil,NotificationSetting::ASSIGNEE => true,NotificationSetting::RESPONSIBLE => true,- NotificationSetting::WATCHED => true+ NotificationSetting::WATCHED => true,+ NotificationSetting::SHARED => true}NotificationSetting.all_settings.each do |key|