20210830174638_maintenance_improve_setting_preferences.rb 436 B

123456789101112131415
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class MaintenanceImproveSettingPreferences < ActiveRecord::Migration[6.0]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. protected_settings = %w[application_secret]
  6. protected_settings.each do |name|
  7. setting = Setting.find_by(name: name)
  8. setting.preferences[:protected] = true
  9. setting.save!
  10. end
  11. end
  12. end