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 . find_by ( name : 'system_init_done' )
setting = Setting . find_by ( name : 'ticket_define_email_from_seperator' )
return if ! setting
2018-10-09 06:17:41 +00:00
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 = {
2018-12-19 17:31:51 +00:00
'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.' ,
2018-12-19 17:31:51 +00:00
'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
}
2017-10-01 12:25:52 +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
2018-10-09 06:17:41 +00:00
2017-01-17 07:35:04 +00:00
local_setting . description = description
local_setting . save!
2017-10-01 12:25:52 +00:00
end
2017-01-17 07:35:04 +00:00
Translation . sync
end
end