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.

Describe the collection_ids setter accurately

Damian Legawiecdd8554faa481
diff --git a/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb
index dc035cbb85..b8e0d7ee86 100644
--- a/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb
+++ b/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb
@@ -181,9 +181,9 @@ module Spree
:promotionable, :digital,
tags: [],
category_ids: [],
- # Manual collection membership. Automatic collections are dropped
- # by the model setter (their members come from their rules), the
- # same way the bulk endpoints scope to `.manual`.
+ # Manual collection membership only — the model setter ignores
+ # incoming automatic collections and preserves the product's
+ # existing ones, since those are materialized from their rules.
collection_ids: [],
metadata: {},
prices: [:amount, :compare_at_amount, :currency],