Skip to content

Instantly share code, notes, and snippets.

@pavelnikolov
Created August 1, 2013 06:33
Show Gist options
  • Save pavelnikolov/6128913 to your computer and use it in GitHub Desktop.
Save pavelnikolov/6128913 to your computer and use it in GitHub Desktop.
Order decorator
module Spree
Order.class_eval do
state_machine.after_transition :to => :complete, :do => :add_subscription
def add_subscription(transition)
# add subscription here - the method is not being called after successfully paying the order. The order and the payment both have state "complete" in the DB
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment