Skip to content

armgit / spree

Public Imported from GitHub
0

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.

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.rb
index 356f2e51c8..6ec92c536e 100644
--- a/core/app/models/spree/product.rb
+++ b/core/app/models/spree/product.rb
@@ -80,7 +80,7 @@ module Spree
has_many :variant_images, -> { order(:position) }, source: :images, through: :variants_including_master
has_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