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.

Add ability to use scoped slugs for products (#12169)

Damian Legawiec7b45f18f35b9
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rb
index 921661b197..0a6555e49c 100644
--- a/core/app/models/spree/product.rb
+++ b/core/app/models/spree/product.rb
@@ -61,7 +61,7 @@ module Spree
end
end
- friendly_id :slug_candidates, use: [:history, :mobility]
+ friendly_id :slug_candidates, use: [:history, :scoped, :mobility], scope: spree_base_uniqueness_scope
acts_as_paranoid
auto_strip_attributes :name