20200527000000_agent_customer.rb 816 B

1234567891011121314151617181920
  1. class AgentCustomer < ActiveRecord::Migration[5.2]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Role.where(name: %w[Admin Agent Customer]).each do |role|
  6. role.preferences.delete(:not)
  7. role.save!
  8. end
  9. move_filter
  10. end
  11. def move_filter
  12. Setting.find_by(name: '0010_postmaster_filter_trusted').update(name: '0005_postmaster_filter_trusted')
  13. Setting.find_by(name: '0020_postmaster_filter_auto_response_check').update(name: '0006_postmaster_filter_auto_response_check')
  14. Setting.find_by(name: '0100_postmaster_filter_follow_up_check').update(name: '0007_postmaster_filter_follow_up_check')
  15. Setting.find_by(name: '0110_postmaster_filter_follow_up_merged').update(name: '0008_postmaster_filter_follow_up_merged')
  16. end
  17. end