Remove some keys from legacy copy/show

Setting with key 'days_to_keep_business_registry_cache' is not copied/shown now.
Setting with key 'default_language' is copied, but shown only once now.
This commit is contained in:
Alex Sherman 2020-08-26 13:31:21 +05:00
parent 75181f5bea
commit 56c7eb5f26
2 changed files with 2 additions and 0 deletions

View file

@ -7,6 +7,7 @@ module Admin
@validation_settings = SettingEntry.with_group('domain_validation')
@expiration_settings = SettingEntry.with_group('domain_expiration')
@other_settings = SettingEntry.with_group('other')
.where.not(code: 'default_language')
@billing_settings = SettingEntry.with_group('billing')
@contacts_settings = SettingEntry.with_group('contacts')
end

View file

@ -52,6 +52,7 @@ class CopyLegacySettingsToNewModel < ActiveRecord::Migration[6.0]
old_settings = ActiveRecord::Base.connection.execute(sql)
old_settings.each do |origin|
next if origin['var'] == 'days_to_keep_business_registry_cache'
entry = SettingEntry.find_or_initialize_by(code: origin['var'])
entry[:format] = 'string'
entry[:format] = 'boolean' if boolean_vars.include? entry.code