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
Fixed: making sure ShippingMethodZone is unique
Damian Legawiec6cb326d92dc9
diff --git a/core/app/models/spree/shipping_method_zone.rb b/core/app/models/spree/shipping_method_zone.rbindex e044c47523..fc500a9d51 100644--- a/core/app/models/spree/shipping_method_zone.rb+++ b/core/app/models/spree/shipping_method_zone.rb@@ -1,6 +1,8 @@module Spreeclass ShippingMethodZone < Spree::Base- belongs_to :shipping_method- belongs_to :zone+ belongs_to :shipping_method, -> { with_deleted }, inverse_of: :shipping_method_zones, class_name: 'Spree::ShippingMethod'+ belongs_to :zone, inverse_of: :shipping_method_zones, class_name: 'Spree::Zone'++ validates :shipping_method, uniqueness: { scope: :zone }endend