20230224134546_duplicate_setting_titles.rb 550 B

1234567891011121314151617
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class DuplicateSettingTitles < 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. settings_update = {
  7. 'ticket_auto_assignment_selector' => 'Auto Assignment Selector',
  8. 'ticket_auto_assignment_user_ids_ignore' => 'Auto Assignment Ignored Users',
  9. }
  10. settings_update.each do |name, title|
  11. Setting.find_by(name: name)&.update!(title: title)
  12. end
  13. end
  14. end