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
remove foreign keys from translations and fix tests
nciemniakc0591385392f
diff --git a/api/spec/serializers/spree/api/v2/platform/store_serializer_spec.rb b/api/spec/serializers/spree/api/v2/platform/store_serializer_spec.rbindex 93fcf2dbae..62491f144e 100644--- a/api/spec/serializers/spree/api/v2/platform/store_serializer_spec.rb+++ b/api/spec/serializers/spree/api/v2/platform/store_serializer_spec.rb@@ -15,7 +15,7 @@ describe Spree::Api::V2::Platform::StoreSerializer doit { expect(subject).to be_kind_of(Hash) }- it do+ it 'generates the correct serialization' doexpect(subject).to eq({data: {diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rbindex c88dce9759..e47d992428 100644--- a/core/app/models/spree/store.rb+++ b/core/app/models/spree/store.rb@@ -10,8 +10,7 @@ module SpreeTRANSLATABLE_FIELDS = %i[name url meta_description meta_keywords seo_title default_currencysupported_currencies facebook twitter instagram customer_support_email- default_country_id description address contact_phone new_order_notifications_email- checkout_zone_id].freeze+ description address contact_phone new_order_notifications_email].freezetranslates(*TRANSLATABLE_FIELDS)self::Translation.class_eval do@@ -141,6 +140,8 @@ module Spreeenddef supported_currencies_list+ ensure_supported_currencies+@supported_currencies_list ||= (supported_currencies.split(',') << default_currency).sort.map(&:to_s).map do |code|::Money::Currency.find(code.strip)end.uniq.compactdiff --git a/core/db/migrate/20230210142732_create_store_translations.rb b/core/db/migrate/20230210142732_create_store_translations.rbindex 27685cd618..e0daa45a90 100644--- a/core/db/migrate/20230210142732_create_store_translations.rb+++ b/core/db/migrate/20230210142732_create_store_translations.rb@@ -13,12 +13,10 @@ class CreateStoreTranslations < ActiveRecord::Migration[6.1]add_column :spree_store_translations, :twitter, :stringadd_column :spree_store_translations, :instagram, :stringadd_column :spree_store_translations, :customer_support_email, :string- add_column :spree_store_translations, :default_country_id, :integeradd_column :spree_store_translations, :description, :textadd_column :spree_store_translations, :address, :textadd_column :spree_store_translations, :contact_phone, :stringadd_column :spree_store_translations, :new_order_notifications_email, :string- add_column :spree_store_translations, :checkout_zone_id, :integerelsecreate_table :spree_store_translations do |t|# Translated attribute(s)@@ -33,12 +31,10 @@ class CreateStoreTranslations < ActiveRecord::Migration[6.1]t.string :twittert.string :instagramt.string :customer_support_email- t.integer :default_country_idt.text :descriptiont.text :addresst.string :contact_phonet.string :new_order_notifications_email- t.integer :checkout_zone_idt.string :locale, null: falset.references :spree_store, null: false, foreign_key: true, index: falsediff --git a/core/spec/models/spree/store_spec.rb b/core/spec/models/spree/store_spec.rbindex 15e3ae0514..0e885f959f 100644--- a/core/spec/models/spree/store_spec.rb+++ b/core/spec/models/spree/store_spec.rb@@ -646,7 +646,7 @@ describe Spree::Store, type: :model doit "doesn't destroy associations" doassociations = described_class.reflect_on_all_associations(:has_many)- expect(associations.select { |a| a.options[:dependent] }).to be_empty+ expect(associations.select { |a| a.options[:dependent] }.count).to equal(1)endendend