From 1e36043a2e836cec130bbff0519db1917d34958e Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 22 May 2023 16:49:24 +0100 Subject: [PATCH] Set unit_value to true when cloning a product This value doesn't get persisted, but it's presence is validated. The product's duplicated variants store the actual :unit_value attribute --- lib/spree/core/product_duplicator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spree/core/product_duplicator.rb b/lib/spree/core/product_duplicator.rb index 409d457af5..5d94a5fe77 100644 --- a/lib/spree/core/product_duplicator.rb +++ b/lib/spree/core/product_duplicator.rb @@ -24,6 +24,7 @@ module Spree new_product.created_at = nil new_product.deleted_at = nil new_product.updated_at = nil + new_product.unit_value = true new_product.product_properties = reset_properties new_product.image = duplicate_image(product.image) if product.image new_product.variants = duplicate_variants