2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-09-08 08:28:34 +00:00
|
|
|
class FixedTranslation2 < ActiveRecord::Migration[4.2]
|
2017-03-14 05:12:10 +00:00
|
|
|
def up
|
|
|
|
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2017-03-14 05:12:10 +00:00
|
|
|
|
|
|
|
settings_update = [
|
|
|
|
{
|
|
|
|
'name' => 'http_type',
|
|
|
|
'title' => 'HTTP type',
|
|
|
|
'description' => 'Define the http protocol of your instance.',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2017-10-01 12:25:52 +00:00
|
|
|
settings_update.each do |setting|
|
2017-03-14 05:12:10 +00:00
|
|
|
fetched_setting = Setting.find_by(name: setting['name'])
|
|
|
|
next if !fetched_setting
|
|
|
|
|
|
|
|
if setting['title']
|
|
|
|
fetched_setting.title = setting['title']
|
|
|
|
end
|
|
|
|
|
|
|
|
if setting['description']
|
|
|
|
fetched_setting.description = setting['description']
|
|
|
|
end
|
|
|
|
|
|
|
|
fetched_setting.save!
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2017-03-14 05:12:10 +00:00
|
|
|
|
2021-11-15 15:58:19 +00:00
|
|
|
Translation.sync
|
2017-03-14 05:12:10 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|