From 3b30854712cc7c50fb49a2ee461b848d938c5ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Wed, 8 Jun 2022 13:22:12 +0200 Subject: [PATCH] Remove wrong definition of :option_values_attributes for variants Having `:option_values_attributes` declared as a plain Symbol has no effect. Rails requires that nested attributes are explicitly declared [1]. Variants already support `:option_value_ids` array [2] which cover the most common use case (adding option values to an already created variant), so there's no need to provide such a nested hierarchy. 1 - https://api.rubyonrails.org/classes/ActionController/StrongParameters.html 2 - https://github.com/solidusio/solidus/blob/07c88ddd1603699939ac0343965fa88dc2e1851a/core/lib/spree/permitted_attributes.rb#L135 --- core/lib/spree/permitted_attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/permitted_attributes.rb b/core/lib/spree/permitted_attributes.rb index 19c54a10545..763ed2148a8 100644 --- a/core/lib/spree/permitted_attributes.rb +++ b/core/lib/spree/permitted_attributes.rb @@ -131,7 +131,7 @@ module PermittedAttributes @@variant_attributes = [ :name, :presentation, :cost_price, :lock_version, :position, :track_inventory, - :product_id, :product, :option_values_attributes, :price, + :product_id, :product, :price, :weight, :height, :width, :depth, :sku, :cost_currency, option_value_ids: [], options: [:name, :value] ]