trabajo-afectivo/db/migrate/20170116000002_fixed_typos_622.rb

36 lines
1.3 KiB
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
2017-09-08 08:28:34 +00:00
class FixedTypos622 < ActiveRecord::Migration[4.2]
2017-01-17 07:35:04 +00:00
def up
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
2017-01-17 07:35:04 +00:00
setting = Setting.find_by(name: 'ticket_define_email_from_seperator')
return if !setting
2017-01-17 07:35:04 +00:00
setting.name = 'ticket_define_email_from_separator'
setting.options[:form][0][:name] = 'ticket_define_email_from_separator'
setting.save!
setting_map = {
'password_min_size' => 'Password needs to have at least minimal size of characters.',
2017-01-17 07:35:04 +00:00
'password_min_2_lower_2_upper_characters' => 'Password needs to contain 2 lower and 2 upper characters.',
'password_need_digit' => 'Password needs to have at least one digit.',
'ticket_subject_size' => 'Max size of the subject in an email reply.',
'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.',
2017-01-17 07:35:04 +00:00
}
setting_map.each do |key, description|
2017-01-17 07:35:04 +00:00
local_setting = Setting.find_by(name: key)
next if !local_setting
2017-01-17 07:35:04 +00:00
local_setting.description = description
local_setting.save!
end
2017-01-17 07:35:04 +00:00
Translation.sync
end
end