Created
September 30, 2014 13:59
-
-
Save braidn/777cce5e81f6c9dd7612 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Extensions | |
module Spree | |
module CheckoutCallbacks | |
extend ActiveSupport::Concern | |
included do | |
set_callback :updating_from_params, :after, :clear_empty_payment | |
def clear_empty_payment | |
#self in this case is the order object | |
byebug | |
if self.payments && self.payments.count > 1 | |
self.payments.last.delete | |
end | |
end | |
end | |
end | |
end | |
end | |
::Spree::Order::Checkout.send(:include, Extensions::Spree::CheckoutCallbacks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment