From 56c7eb5f261db0f6257eeb1c5d4c1d2e7f2082c6 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 26 Aug 2020 13:31:21 +0500 Subject: [PATCH] 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. --- app/controllers/admin/settings_controller.rb | 1 + db/data/20200812093540_copy_legacy_settings_to_new_model.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index fa538ad62..8a5c275c5 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -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 diff --git a/db/data/20200812093540_copy_legacy_settings_to_new_model.rb b/db/data/20200812093540_copy_legacy_settings_to_new_model.rb index 7d45867ec..bb762aa21 100644 --- a/db/data/20200812093540_copy_legacy_settings_to_new_model.rb +++ b/db/data/20200812093540_copy_legacy_settings_to_new_model.rb @@ -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