Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Deprecate `Spree::Config[:currency']`
Damian Legawiec170a680e602c
diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rbindex d4d2cc1fd5..b5096df58c 100644--- a/api/spec/spec_helper.rb+++ b/api/spec/spec_helper.rb@@ -70,9 +70,7 @@ RSpec.configure do |config|Spree::Api::Config[:requires_authentication] = truecountry = create(:country, name: 'United States of America', iso_name: 'UNITED STATES', iso: 'US', states_required: true)- Spree::Config[:default_country_id] = country.id-- create(:store, default: true)+ create(:store, default: true, default_country: country, default_currency: 'USD')end# Force jobs to be executed in a synchronous way (see http://archive.today/xcb1E)diff --git a/core/app/helpers/spree/currency_helper.rb b/core/app/helpers/spree/currency_helper.rbindex cc55ac1aa5..2e354683ef 100644--- a/core/app/helpers/spree/currency_helper.rb+++ b/core/app/helpers/spree/currency_helper.rb@@ -1,7 +1,7 @@module Spreemodule CurrencyHelperdef currency_options(selected_value = nil)- selected_value ||= Spree::Config[:currency]+ selected_value ||= Spree::Store.default.default_currencycurrencies = ::Money::Currency.table.map do |_code, details|iso = details[:iso_code][iso, "#{details[:name]} (#{iso})"]diff --git a/core/app/models/concerns/spree/default_price.rb b/core/app/models/concerns/spree/default_price.rbindex 0409cc9479..19528ef0e3 100644--- a/core/app/models/concerns/spree/default_price.rb+++ b/core/app/models/concerns/spree/default_price.rb@@ -4,7 +4,7 @@ module Spreeincluded dohas_one :default_price,- -> { with_deleted.where(currency: Spree::Config[:currency]) },+ -> { with_deleted.where(currency: Spree::Store.default.default_currency) },class_name: 'Spree::Price',dependent: :destroydiff --git a/core/app/models/concerns/spree/product_scopes.rb b/core/app/models/concerns/spree/product_scopes.rbindex b72fe9aeec..5caceb5cd1 100644--- a/core/app/models/concerns/spree/product_scopes.rb+++ b/core/app/models/concerns/spree/product_scopes.rb@@ -245,7 +245,7 @@ module Spreescope = not_discontinued.where("#{Product.quoted_table_name}.available_on <= ?", available_on)unless Spree::Config.show_products_without_price- currency ||= Spree::Config[:currency]+ currency ||= Spree::Store.default.default_currencyscope = scope.with_currency(currency)enddiff --git a/core/app/models/spree/app_configuration.rb b/core/app/models/spree/app_configuration.rbindex f707fb2218..6d73241b06 100644--- a/core/app/models/spree/app_configuration.rb+++ b/core/app/models/spree/app_configuration.rb@@ -41,7 +41,7 @@ module Spreepreference :binary_inventory_cache, :boolean, default: false # only invalidate product cache when a stock item changes whether it is in_stockpreference :checkout_zone, :string, default: nil # replace with the name of a zone if you would like to limit the countriespreference :company, :boolean, default: false # Request company field for billing and shipping addr- preference :currency, :string, default: 'USD'+ preference :currency, :string, default: 'USD', deprecated: truepreference :default_country_id, :integerpreference :disable_sku_validation, :boolean, default: false # when turned off disables the built-in SKU uniqueness validationpreference :disable_store_presence_validation, :boolean, default: false # when turned off disables Store presence validation for Products and Payment Methodsdiff --git a/core/app/models/spree/calculator/flat_rate.rb b/core/app/models/spree/calculator/flat_rate.rbindex b79757cff8..c1398b0ca9 100644--- a/core/app/models/spree/calculator/flat_rate.rb+++ b/core/app/models/spree/calculator/flat_rate.rb@@ -3,7 +3,7 @@ require_dependency 'spree/calculator'module Spreeclass Calculator::FlatRate < Calculatorpreference :amount, :decimal, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:flat_rate_per_order)diff --git a/core/app/models/spree/calculator/flexi_rate.rb b/core/app/models/spree/calculator/flexi_rate.rbindex 5a43ac1dca..27fae73e6e 100644--- a/core/app/models/spree/calculator/flexi_rate.rb+++ b/core/app/models/spree/calculator/flexi_rate.rb@@ -5,7 +5,7 @@ module Spreepreference :first_item, :decimal, default: 0.0preference :additional_item, :decimal, default: 0.0preference :max_items, :integer, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:flexible_rate)diff --git a/core/app/models/spree/calculator/price_sack.rb b/core/app/models/spree/calculator/price_sack.rbindex 7d9a08e8c2..b9c6f29889 100644--- a/core/app/models/spree/calculator/price_sack.rb+++ b/core/app/models/spree/calculator/price_sack.rb@@ -5,7 +5,7 @@ module Spreepreference :minimal_amount, :decimal, default: 0preference :normal_amount, :decimal, default: 0preference :discount_amount, :decimal, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:price_sack)diff --git a/core/app/models/spree/calculator/shipping/digital_delivery.rb b/core/app/models/spree/calculator/shipping/digital_delivery.rbindex 2ec7a21bbc..238848cb14 100644--- a/core/app/models/spree/calculator/shipping/digital_delivery.rb+++ b/core/app/models/spree/calculator/shipping/digital_delivery.rb@@ -4,7 +4,7 @@ module Spreemodule Calculator::Shippingclass DigitalDelivery < ShippingCalculatorpreference :amount, :decimal, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t('digital.digital_delivery')diff --git a/core/app/models/spree/calculator/shipping/flat_rate.rb b/core/app/models/spree/calculator/shipping/flat_rate.rbindex 9e0755abcb..fcb6740648 100644--- a/core/app/models/spree/calculator/shipping/flat_rate.rb+++ b/core/app/models/spree/calculator/shipping/flat_rate.rb@@ -4,7 +4,7 @@ module Spreemodule Calculator::Shippingclass FlatRate < ShippingCalculatorpreference :amount, :decimal, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:shipping_flat_rate_per_order)diff --git a/core/app/models/spree/calculator/shipping/flexi_rate.rb b/core/app/models/spree/calculator/shipping/flexi_rate.rbindex cc43ad5695..8cc353b163 100644--- a/core/app/models/spree/calculator/shipping/flexi_rate.rb+++ b/core/app/models/spree/calculator/shipping/flexi_rate.rb@@ -6,7 +6,7 @@ module Spreepreference :first_item, :decimal, default: 0.0preference :additional_item, :decimal, default: 0.0preference :max_items, :integer, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:shipping_flexible_rate)diff --git a/core/app/models/spree/calculator/shipping/per_item.rb b/core/app/models/spree/calculator/shipping/per_item.rbindex ff5e990f74..b7fba7b5f7 100644--- a/core/app/models/spree/calculator/shipping/per_item.rb+++ b/core/app/models/spree/calculator/shipping/per_item.rb@@ -4,7 +4,7 @@ module Spreemodule Calculator::Shippingclass PerItem < ShippingCalculatorpreference :amount, :decimal, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:shipping_flat_rate_per_item)diff --git a/core/app/models/spree/calculator/shipping/price_sack.rb b/core/app/models/spree/calculator/shipping/price_sack.rbindex b55b805445..e1f51b131e 100644--- a/core/app/models/spree/calculator/shipping/price_sack.rb+++ b/core/app/models/spree/calculator/shipping/price_sack.rb@@ -6,7 +6,7 @@ module Spreepreference :minimal_amount, :decimal, default: 0preference :normal_amount, :decimal, default: 0preference :discount_amount, :decimal, default: 0- preference :currency, :string, default: -> { Spree::Config[:currency] }+ preference :currency, :string, default: -> { Spree::Store.default.default_currency }def self.descriptionSpree.t(:shipping_price_sack)diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rbindex 76ab746c6d..3afa3dc55d 100644--- a/core/app/models/spree/order.rb+++ b/core/app/models/spree/order.rb@@ -717,7 +717,7 @@ module Spreeenddef ensure_currency_presence- self.currency ||= store.default_currency || Spree::Config[:currency]+ self.currency ||= store.default_currencyenddef create_tokendiff --git a/core/app/models/spree/price.rb b/core/app/models/spree/price.rbindex 73e3cffde0..1f012410e0 100644--- a/core/app/models/spree/price.rb+++ b/core/app/models/spree/price.rb@@ -66,7 +66,7 @@ module Spreeprivatedef ensure_currency- self.currency ||= Spree::Config[:currency]+ self.currency ||= Spree::Store.default.default_currencyendendenddiff --git a/core/app/models/spree/return_authorization.rb b/core/app/models/spree/return_authorization.rbindex a2e1dc4baa..43c11796fc 100644--- a/core/app/models/spree/return_authorization.rb+++ b/core/app/models/spree/return_authorization.rb@@ -44,7 +44,8 @@ module Spreeenddef currency- order.nil? ? Spree::Config[:currency] : order.currency+ # FIXME: we should associate ReturnAuthorization with Store+ order.nil? ? Spree::Store.default.default_currency : order.currencyenddef refundable_amountdiff --git a/core/app/models/spree/return_item.rb b/core/app/models/spree/return_item.rbindex f442b87b1b..cd9522acd7 100644--- a/core/app/models/spree/return_item.rb+++ b/core/app/models/spree/return_item.rb@@ -165,7 +165,7 @@ module Spreeenddef currency- return_authorization.try(:currency) || Spree::Config[:currency]+ return_authorization.try(:currency) || Spree::Store.default.default_currencyendprivatediff --git a/core/app/models/spree/variant.rb b/core/app/models/spree/variant.rbindex dd97b9de70..7ae937fe9f 100644--- a/core/app/models/spree/variant.rb+++ b/core/app/models/spree/variant.rb@@ -93,7 +93,7 @@ module Spreescope :not_deleted, -> { where("#{Spree::Variant.quoted_table_name}.deleted_at IS NULL") }scope :for_currency_and_available_price_amount, ->(currency = nil) do- currency ||= Spree::Config[:currency]+ currency ||= Spree::Store.default.default_currencyjoins(:prices).where('spree_prices.currency = ?', currency).where('spree_prices.amount IS NOT NULL').distinctend@@ -338,12 +338,12 @@ module Spreeself.price = product.master.priceendif price.present? && currency.nil?- self.currency = Spree::Config[:currency]+ self.currency = Spree::Store.default.default_currencyendenddef set_cost_currency- self.cost_currency = Spree::Config[:currency] if cost_currency.blank?+ self.cost_currency = Spree::Store.default.default_currency if cost_currency.blank?enddef create_stock_itemsdiff --git a/core/lib/spree/core/controller_helpers/currency.rb b/core/lib/spree/core/controller_helpers/currency.rbindex c9599f6350..1a223a2799 100644--- a/core/lib/spree/core/controller_helpers/currency.rb+++ b/core/lib/spree/core/controller_helpers/currency.rb@@ -20,7 +20,7 @@ module Spreeelsif current_store.present?current_store.default_currencyelse- Spree::Config[:currency]+ Spree::Store.default.default_currencyend&.upcaseenddiff --git a/core/lib/spree/money.rb b/core/lib/spree/money.rbindex 816fc5d0fd..d37542755a 100644--- a/core/lib/spree/money.rb+++ b/core/lib/spree/money.rb@@ -21,7 +21,7 @@ module Spreedef initialize(amount, options = {})use_default_currency- @money = Monetize.parse([amount, (options[:currency] || Spree::Config[:currency])].join)+ @money = Monetize.parse([amount, (options[:currency] || Spree::Store.default.default_currency)].join)@options = Spree::Money.default_formatting_rules.merge(options)end@@ -66,7 +66,7 @@ module Spreeenddef use_default_currency- currency = Spree::Store.default.default_currency || Spree::Config[:currency]+ currency = Spree::Store.default.default_currency::Money.default_currency = currencyenddiff --git a/core/lib/tasks/core.rake b/core/lib/tasks/core.rakeindex 27454d517e..83df7d670c 100644--- a/core/lib/tasks/core.rake+++ b/core/lib/tasks/core.rake@@ -180,7 +180,7 @@ use rake db:load_file[/absolute/path/to/sample/filename.rb]}task ensure_order_currency_presence: :environment do |_t, _args|Spree::Order.where(currency: nil).find_in_batches do |orders|orders.each do |order|- order.update!(currency: order.store.default_currency || Spree::Config[:currency])+ order.update!(currency: order.store.default_currency)endendenddiff --git a/core/spec/lib/search/base_spec.rb b/core/spec/lib/search/base_spec.rbindex 348d990fc8..3719dd06e0 100644--- a/core/spec/lib/search/base_spec.rb+++ b/core/spec/lib/search/base_spec.rb@@ -65,7 +65,7 @@ describe Spree::Core::Search::Base doit 'accepts multiple currencies' dopln_price- Spree::Config[:currency] = 'PLN'+ Spree::Store.default.update(default_currency: 'PLN')params_pln = { per_page: '', search: { 'price_range_any' => ['Under 10.00 zł', '10.00 zł - 15.00 zł'] } }searcher_pln = described_class.new(ActionController::Parameters.new(params_pln))searcher_pln.current_currency = 'PLN'diff --git a/core/spec/lib/spree/core/importer/order_spec.rb b/core/spec/lib/spree/core/importer/order_spec.rbindex cead9c0619..7b303d020f 100644--- a/core/spec/lib/spree/core/importer/order_spec.rb+++ b/core/spec/lib/spree/core/importer/order_spec.rb@@ -3,7 +3,7 @@ require 'spec_helper'module Spreemodule Coredescribe Importer::Order do- let(:store) { create(:store, default_country: create(:country, iso: 'US')) }+ let(:store) { Spree::Store.default }let!(:country) { store.default_country }let!(:state) { country.states.first || create(:state, country: country) }let!(:stock_location) { create(:stock_location, admin_name: 'Admin Name') }diff --git a/core/spec/lib/spree/money_spec.rb b/core/spec/lib/spree/money_spec.rbindex 2104595cd8..0063150055 100644--- a/core/spec/lib/spree/money_spec.rb+++ b/core/spec/lib/spree/money_spec.rb@@ -78,9 +78,7 @@ describe Spree::Money docontext 'JPY' dobefore do- configure_spree_preferences do |config|- config.currency = 'JPY'- end+ Spree::Store.default.update(default_currency: 'JPY')endit 'formats correctly' do@@ -91,9 +89,7 @@ describe Spree::Money docontext 'EUR' dobefore do- configure_spree_preferences do |config|- config.currency = 'EUR'- end+ Spree::Store.default.update(default_currency: 'EUR')end# Regression test for #2634diff --git a/core/spec/models/spree/adjustment_spec.rb b/core/spec/models/spree/adjustment_spec.rbindex 45ba8bf0b9..077ea99116 100644--- a/core/spec/models/spree/adjustment_spec.rb+++ b/core/spec/models/spree/adjustment_spec.rb@@ -55,7 +55,7 @@ describe Spree::Adjustment, type: :model doendcontext '#save' do- let(:order) { Spree::Order.create! }+ let(:order) { create(:order) }let!(:adjustment) { Spree::Adjustment.create(label: 'Adjustment', amount: 5, order: order, adjustable: order) }it 'touches the adjustable' dodiff --git a/core/spec/models/spree/order/callbacks_spec.rb b/core/spec/models/spree/order/callbacks_spec.rbindex 73cd73716f..dbd57b8731 100644--- a/core/spec/models/spree/order/callbacks_spec.rb+++ b/core/spec/models/spree/order/callbacks_spec.rb@@ -1,7 +1,7 @@require 'spec_helper'describe Spree::Order, type: :model do- let(:order) { stub_model(Spree::Order) }+ let(:order) { build(:order) }before doSpree::Order.define_state_machine!diff --git a/core/spec/models/spree/order/store_credit_spec.rb b/core/spec/models/spree/order/store_credit_spec.rbindex a895958ae3..cbf7ba89e3 100644--- a/core/spec/models/spree/order/store_credit_spec.rb+++ b/core/spec/models/spree/order/store_credit_spec.rb@@ -214,7 +214,7 @@ describe 'Order' docontext 'the associated user has store credits' dosubject { order }- let(:store) { create(:store) }+ let(:store) { Spree::Store.default }let(:store_credit) { create(:store_credit, store: store) }let(:order) { create(:order, user: store_credit.user, store: store) }diff --git a/core/spec/models/spree/price_spec.rb b/core/spec/models/spree/price_spec.rbindex 294162b7ab..a74deb12b6 100644--- a/core/spec/models/spree/price_spec.rb+++ b/core/spec/models/spree/price_spec.rb@@ -2,7 +2,7 @@ require 'spec_helper'describe Spree::Price, type: :model dodescribe '#amount=' do- let(:price) { Spree::Price.new }+ let(:price) { build :price }let(:amount) { '3,0A0' }before do@@ -15,7 +15,7 @@ describe Spree::Price, type: :model doenddescribe '#compare_at_amount=' do- let(:price) { Spree::Price.new }+ let(:price) { build :price }let(:compare_at_amount) { '169.99' }before do@@ -28,7 +28,7 @@ describe Spree::Price, type: :model doenddescribe '#price' do- let(:price) { Spree::Price.new }+ let(:price) { build :price }let(:amount) { 3000.00 }context 'when amount is changed' do@@ -43,7 +43,7 @@ describe Spree::Price, type: :model doenddescribe '#compare_at_price' do- let(:price) { Spree::Price.new }+ let(:price) { build :price }let(:compare_at_amount) { 3000.00 }context 'when amount is changed' do@@ -58,7 +58,7 @@ describe Spree::Price, type: :model doenddescribe 'validations' do- subject { Spree::Price.new variant: variant, amount: amount }+ subject { build :price, variant: variant, amount: amount }let(:variant) { stub_model Spree::Variant }@@ -107,7 +107,7 @@ describe Spree::Price, type: :model dolet(:zone) { Spree::Zone.new }let(:amount) { 10 }let(:tax_category) { Spree::TaxCategory.new }- let(:price) { Spree::Price.new variant: variant, amount: amount }+ let(:price) { build :price, variant: variant, amount: amount }let(:price_options) { { tax_zone: zone } }context 'when called with a non-default zone' do@@ -158,7 +158,7 @@ describe Spree::Price, type: :model dolet(:amount) { 10 }let(:compare_at_amount) { 100 }let(:tax_category) { Spree::TaxCategory.new }- let(:price) { Spree::Price.new variant: variant, amount: amount, compare_at_amount: compare_at_amount }+ let(:price) { build :price, variant: variant, amount: amount, compare_at_amount: compare_at_amount }let(:price_options) { { tax_zone: zone } }context 'when called with a non-default zone' do@@ -201,7 +201,7 @@ describe Spree::Price, type: :model doenddescribe '#display_price_including_vat_for(zone)' do- subject { Spree::Price.new amount: 10 }+ subject { build :price, amount: 10 }it 'calls #price_including_vat_for' doexpect(subject).to receive(:price_including_vat_for)@@ -210,7 +210,7 @@ describe Spree::Price, type: :model doenddescribe '#display_compare_at_price_including_vat_for(zone)' do- subject { Spree::Price.new amount: 10, compare_at_amount: 100 }+ subject { build :price, amount: 10, compare_at_amount: 100 }it 'calls #price_including_vat_for' doexpect(subject).to receive(:compare_at_price_including_vat_for)diff --git a/core/spec/models/spree/promotion/rules/item_total_spec.rb b/core/spec/models/spree/promotion/rules/item_total_spec.rbindex d75b369629..f5bdab42e9 100644--- a/core/spec/models/spree/promotion/rules/item_total_spec.rb+++ b/core/spec/models/spree/promotion/rules/item_total_spec.rb@@ -1,6 +1,7 @@require 'spec_helper'describe Spree::Promotion::Rules::ItemTotal, type: :model do+ let!(:store) { create(:store, default: true) }let(:rule) { Spree::Promotion::Rules::ItemTotal.new }let(:order) { double(:order) }diff --git a/core/spec/models/spree/promotion_handler/coupon_spec.rb b/core/spec/models/spree/promotion_handler/coupon_spec.rbindex 4db976cc1a..156feeb96d 100644--- a/core/spec/models/spree/promotion_handler/coupon_spec.rb+++ b/core/spec/models/spree/promotion_handler/coupon_spec.rb@@ -5,7 +5,7 @@ module Spreedescribe Coupon, type: :model dosubject { Coupon.new(order) }- let(:store) { create(:store) }+ let(:store) { Spree::Store.default }let(:order) { double('Order', coupon_code: '10off', store: store).as_null_object }it 'returns self in apply' dodiff --git a/core/spec/models/spree/store_credit_spec.rb b/core/spec/models/spree/store_credit_spec.rbindex 95a1efbc10..34d89588c9 100644--- a/core/spec/models/spree/store_credit_spec.rb+++ b/core/spec/models/spree/store_credit_spec.rb@@ -739,7 +739,7 @@ describe 'StoreCredit' doenddescribe '#store_events' do- let(:store) { create(:store) }+ let(:store) { Spree::Store.default }context 'create' docontext 'user has one store credit' dodiff --git a/core/spec/models/spree/store_spec.rb b/core/spec/models/spree/store_spec.rbindex ebf63b4d78..462d31c779 100644--- a/core/spec/models/spree/store_spec.rb+++ b/core/spec/models/spree/store_spec.rb@@ -266,9 +266,11 @@ describe Spree::Store, type: :model docontext 'when a default store is not present' doit 'builds a new default store' do- expect(Spree::Store.default.class).to eq(Spree::Store)- expect(Spree::Store.default.persisted?).to eq(false)- expect(Spree::Store.default.default).to be(true)+ described_class.delete_all+ Rails.cache.clear+ expect(described_class.default.class).to eq(described_class)+ expect(described_class.default.persisted?).to eq(false)+ expect(described_class.default.default).to be(true)endendenddiff --git a/core/spec/models/spree/variant_spec.rb b/core/spec/models/spree/variant_spec.rbindex 19a4173c60..a16272761c 100644--- a/core/spec/models/spree/variant_spec.rb+++ b/core/spec/models/spree/variant_spec.rb@@ -865,7 +865,7 @@ describe Spree::Variant, type: :model docontext 'price present and currency nil' dobefore { variant.currency = nil }- it { expect(variant.send(:check_price)).to be(Spree::Config[:currency]) }+ it { expect(variant.send(:check_price)).to eq(Spree::Store.default.default_currency) }endcontext 'price nil and currency present' do@@ -891,7 +891,7 @@ describe Spree::Variant, type: :model docontext 'price present and currency nil' dobefore { variant.currency = nil }- it { expect(variant.send(:check_price)).to be(Spree::Config[:currency]) }+ it { expect(variant.send(:check_price)).to eq(Spree::Store.default.default_currency) }endcontext 'product and master_variant present and equal' dodiff --git a/core/spec/spec_helper.rb b/core/spec/spec_helper.rbindex 0623d3f17e..197737f569 100644--- a/core/spec/spec_helper.rb+++ b/core/spec/spec_helper.rb@@ -63,6 +63,9 @@ RSpec.configure do |config|beginRails.cache.clearreset_spree_preferences++ country = create(:country, name: 'United States of America', iso_name: 'UNITED STATES', iso: 'US', states_required: true)+ create(:store, default: true, default_country: country, default_currency: 'USD')rescue Errno::ENOTEMPTYendenddiff --git a/sample/db/samples/products.rb b/sample/db/samples/products.rbindex 608a47937b..60b4076450 100644--- a/sample/db/samples/products.rb+++ b/sample/db/samples/products.rb@@ -8,8 +8,6 @@ Spree::Sample.load_sample('stores')default_shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default')clothing_tax_category = Spree::TaxCategory.find_or_create_by!(name: 'Clothing')-Spree::Config[:currency] = 'USD'-color = Spree::OptionType.find_by!(name: 'color')length = Spree::OptionType.find_by!(name: 'length')size = Spree::OptionType.find_by!(name: 'size')