20221221082844_and_or_conditions_setting_default.rb 643 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class AndOrConditionsSettingDefault < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. expert_setting = Setting.find_by(name: 'ticket_allow_expert_conditions')
  7. return if !expert_setting
  8. expert_setting.area = 'Ticket::Core'
  9. expert_setting.state_current = { value: true }
  10. expert_setting.state_initial = { value: true }
  11. expert_setting.preferences[:online_service_disable] = true
  12. expert_setting.preferences.delete(:prio)
  13. expert_setting.save!
  14. end
  15. end