From 8d0cbe886aa29137b971d5e76346c9ff2e5b7dcc Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 14 Nov 2021 12:38:53 +0000 Subject: [PATCH] Rename method for clarity --- app/controllers/checkout_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 8567f30502..6c22089cb4 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -81,14 +81,14 @@ class CheckoutController < ::BaseController def load_order @order = current_order - redirect_to(main_app.shop_path) && return if redirect_to_shop? + redirect_to(main_app.shop_path) && return if order_invalid_for_checkout? handle_invalid_stock && return unless valid_order_line_items? before_address setup_for_current_state end - def redirect_to_shop? + def order_invalid_for_checkout? !@order || !@order.checkout_allowed? || @order.completed?