From 175b8361e53ab0520f328e8e2ff1cc113ed42485 Mon Sep 17 00:00:00 2001 From: Sean Schofield Date: Mon, 27 Sep 2010 11:13:07 -0400 Subject: [PATCH] CheckoutController now consults Order#completed? in determining if we're done the checkout process. This removes the assumption that customized state machines will always be in a "complete" state when the checkout is finished. --- core/app/controllers/checkout_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/app/controllers/checkout_controller.rb b/core/app/controllers/checkout_controller.rb index c6c5be53e41..c8c819eb6e0 100644 --- a/core/app/controllers/checkout_controller.rb +++ b/core/app/controllers/checkout_controller.rb @@ -11,8 +11,7 @@ def update if @order.update_attributes(object_params) if @order.next state_callback(:after) - @order.next if @order.state == "adjustments" - if @order.state == "complete" + if @order.state == "complete" or @order.completed? flash[:notice] = I18n.t(:order_processed_successfully) redirect_to completion_route and return else