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
When restoring softly deleted products we need to bring them back with their respective store associations
Damian Legawiec534d30af99ba
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rbindex 356f2e51c8..6ec92c536e 100644--- a/core/app/models/spree/product.rb+++ b/core/app/models/spree/product.rb@@ -80,7 +80,7 @@ module Spreehas_many :variant_images, -> { order(:position) }, source: :images, through: :variants_including_masterhas_many :variant_images_without_master, -> { order(:position) }, source: :images, through: :variants- has_many :store_products, class_name: 'Spree::StoreProduct', dependent: :destroy+ has_many :store_products, class_name: 'Spree::StoreProduct'has_many :stores, through: :store_products, class_name: 'Spree::Store'after_create :add_associations_from_prototype