20200527000000_agent_customer.rb 979 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class AgentCustomer < ActiveRecord::Migration[5.2]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Role.where(name: %w[Admin Agent Customer]).each do |role|
  7. role.preferences.delete(:not)
  8. role.update_column(:preferences, role.preferences) # rubocop:disable Rails/SkipsModelValidations
  9. end
  10. move_filter
  11. end
  12. def move_filter
  13. Setting.find_by(name: '0010_postmaster_filter_trusted').update(name: '0005_postmaster_filter_trusted')
  14. Setting.find_by(name: '0020_postmaster_filter_auto_response_check').update(name: '0006_postmaster_filter_auto_response_check')
  15. Setting.find_by(name: '0100_postmaster_filter_follow_up_check').update(name: '0007_postmaster_filter_follow_up_check')
  16. Setting.find_by(name: '0110_postmaster_filter_follow_up_merged').update(name: '0008_postmaster_filter_follow_up_merged')
  17. end
  18. end