20170116000002_fixed_typos_622.rb 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. class FixedTypos622 < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. setting = Setting.find_by(name: 'ticket_define_email_from_seperator')
  6. return if !setting
  7. setting.name = 'ticket_define_email_from_separator'
  8. setting.options[:form][0][:name] = 'ticket_define_email_from_separator'
  9. setting.save!
  10. setting_map = {
  11. 'password_min_size' => 'Password needs to have at least minimal size of characters.',
  12. 'password_min_2_lower_2_upper_characters' => 'Password needs to contain 2 lower and 2 upper characters.',
  13. 'password_need_digit' => 'Password needs to have at least one digit.',
  14. 'ticket_subject_size' => 'Max size of the subject in an email reply.',
  15. 'postmaster_follow_up_search_in' => 'In default the follow up check is done via the subject of an email. With this setting you can add more fields where the follow up check is executed.',
  16. }
  17. setting_map.each do |key, description|
  18. local_setting = Setting.find_by(name: key)
  19. next if !local_setting
  20. local_setting.description = description
  21. local_setting.save!
  22. end
  23. Translation.sync
  24. end
  25. end