Remove unused preference default_country_id

This commit is contained in:
Maikel Linke
2025-01-28 14:19:49 +11:00
parent 4b6c3fe1d0
commit 6885184bcc
5 changed files with 11 additions and 9 deletions

View File

@@ -37,7 +37,6 @@ module Spree
preference :currency_symbol_position, :string, default: "before"
preference :currency_thousands_separator, :string, default: ","
preference :display_currency, :boolean, default: false
preference :default_country_id, :integer
preference :default_meta_description, :string, default: 'OFN demo site'
preference :default_meta_keywords, :string, default: 'ofn, demo'
preference :default_seo_title, :string, default: ''

View File

@@ -0,0 +1,10 @@
# frozen_string_literal: true
class DeleteDefaultCountryIdPreference < ActiveRecord::Migration[7.0]
def up
execute <<~SQL.squish
DELETE FROM spree_preferences
WHERE key = '/spree/app_configuration/default_country_id '
SQL
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2025_01_13_055412) do
ActiveRecord::Schema[7.0].define(version: 2025_01_28_031518) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "plpgsql"

View File

@@ -234,12 +234,10 @@ RSpec.configure do |config|
end
end
default_country_id = DefaultCountry.id
# Ensure we start with consistent config settings
config.before(:each) do
reset_spree_preferences do |spree_config|
# These are all settings that differ from Spree's defaults
spree_config.default_country_id = default_country_id
spree_config.shipping_instructions = true
end
CurrentConfig.clear_all

View File

@@ -22,8 +22,3 @@ if Spree::Country.where(name: "France").empty?
Spree::State.create!({ "name" => "Alsace", "abbr" => "Als", :country => country })
Spree::State.create!({ "name" => "Aquitaine", "abbr" => "Aq", :country => country })
end
# Since the country seeding differs from other environments, the default
# country id has to be updated here. This line can be removed as soon as the
# default country id is replaced by something database independent.
Spree::Config.default_country_id = Spree::Country.find_by(name: 'Australia').id