Skip to content

Commit

Permalink
simplify require_shipping? check in PaypalOrder with separated step_n…
Browse files Browse the repository at this point in the history
…ames method
  • Loading branch information
retsef committed Dec 23, 2021
1 parent ff773eb commit 26491c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/solidus_paypal_commerce_platform/paypal_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 26491c9

Please sign in to comment.