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
Use _ids methods rather than pluck, also load only product option types
Damian Legawiec7c87008993b8
diff --git a/backend/app/views/spree/admin/products/_form.html.erb b/backend/app/views/spree/admin/products/_form.html.erbindex 19d8f9fd62..7147e8fe95 100644--- a/backend/app/views/spree/admin/products/_form.html.erb+++ b/backend/app/views/spree/admin/products/_form.html.erb@@ -194,7 +194,7 @@<%= f.label :taxon_ids, Spree.t(:taxons) %><% if can? :modify, Spree::Classification %>- <%= f.select :taxon_ids, options_from_collection_for_select(@product.taxons, :id, :pretty_name, @product.taxons.pluck(:id)), { include_hidden: true }, multiple: true, class: 'select2-hidden-accessible' %>+ <%= f.select :taxon_ids, options_from_collection_for_select(@product.taxons, :id, :pretty_name, @product.taxon_ids), { include_hidden: true }, multiple: true, class: 'select2-hidden-accessible' %><% elsif @product.taxons.any? %><ul class="text_list"><% @product.taxons.each do |taxon| %>@@ -213,7 +213,7 @@<%= f.label :option_type_ids, Spree.t(:option_types) %><% if can? :modify, Spree::ProductOptionType %>- <%= f.select :option_type_ids, options_from_collection_for_select(Spree::OptionType.all, :id, :name, @product.option_types.pluck(:id)), { include_hidden: true }, multiple: true, class: 'select2-hidden-accessible' %>+ <%= f.select :option_type_ids, options_from_collection_for_select(@product.option_types, :id, :name, @product.option_type_ids), { include_hidden: true }, multiple: true, class: 'select2-hidden-accessible' %><% elsif @product.option_types.any? %><ul class="text_list"><% @product.option_types.each do |type| %>