From 26491c93e5e2495d30a755c3daee0d0cdb1176cf Mon Sep 17 00:00:00 2001 From: Roberto Scinocca Date: Thu, 23 Dec 2021 10:50:57 +0100 Subject: [PATCH] simplify require_shipping? check in PaypalOrder with separated step_names method --- app/models/solidus_paypal_commerce_platform/paypal_order.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/solidus_paypal_commerce_platform/paypal_order.rb b/app/models/solidus_paypal_commerce_platform/paypal_order.rb index 78366582..11370821 100644 --- a/app/models/solidus_paypal_commerce_platform/paypal_order.rb +++ b/app/models/solidus_paypal_commerce_platform/paypal_order.rb @@ -129,9 +129,11 @@ def application_context end def require_shipping? - step_names = @order ? @order.checkout_steps : ::Spree::Order.checkout_steps.keys + step_names.include? :delivery + end - step_names.include? 'delivery' + def step_names + @order ? @order.checkout_steps.map(&:to_sym) : ::Spree::Order.checkout_steps.keys end def greater_than_2_10?