Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
Fix that saving completed order would delete store credit adjustments
Browse files Browse the repository at this point in the history
Because when the order is completed the credits are consumed, the
user no longer has sufficient credit to cover the adjustments so
they were being destroyed.
  • Loading branch information
David North committed May 9, 2012
1 parent e590e36 commit c49a9d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/spree/order_decorator.rb
Expand Up @@ -7,7 +7,7 @@ module Spree
# admin app when creating a new order from the admin console
# In that case, we create an order before assigning a user
before_save :process_store_credit, :if => "self.user.present? && @store_credit_amount"
after_save :ensure_sufficient_credit, :if => "self.user.present?"
after_save :ensure_sufficient_credit, :if => "self.user.present? && !self.completed?"

validates_with StoreCreditMinimumValidator

Expand Down

0 comments on commit c49a9d2

Please sign in to comment.