From ced60d43825d497e9a390cd213a710d00cc0bc00 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 7 Jun 2023 13:33:50 +0100 Subject: [PATCH] Remove superfluous method from products controller --- app/controllers/spree/admin/products_controller.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index 13700e4c39..78f26faf6e 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -206,7 +206,7 @@ module Spree end def set_stock_levels(product, on_hand, on_demand) - variant = product_variant(product) + variant = product.variants.first begin variant.on_demand = on_demand if on_demand.present? @@ -226,12 +226,6 @@ module Spree end end - def product_variant(product) - return unless product.variants.any? - - product.variants.first - end - def set_product_master_variant_price_to_zero @product.price = 0 if @product.price.nil? end