From 7e018fb2d20dd20b5df13aef9c83b277c622c2a1 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 2 May 2012 10:38:51 -0500 Subject: [PATCH] Need to call after_complete state callback so that session[:order_id] is nil'd after successful order. Related to #48. --- app/controllers/spree/checkout_controller_decorator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index 7227ad7..d745e9a 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -146,6 +146,7 @@ module Spree end @order.update_attribute(:state, "complete") + state_callback(:after) # So that after_complete is called, setting session[:order_id] to nil @order.finalize! flash[:notice] = I18n.t(:order_processed_successfully) redirect_to completion_route