Skip to content

Commit

Permalink
CheckoutController now consults Order#completed? in determining if we…
Browse files Browse the repository at this point in the history
…'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.
  • Loading branch information
schof authored and Zac Williams committed Sep 28, 2010
1 parent 11236fa commit 175b836
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/app/controllers/checkout_controller.rb
Expand Up @@ -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
Expand Down

0 comments on commit 175b836

Please sign in to comment.