Last active
August 29, 2015 14:20
-
-
Save dfreerksen/dd8c7235f0dd431c0c59 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
# app/controllers/spree/checkout_controller_decorator.rb | |
Spree::CheckoutController.class_eval do | |
after_action :after_order_processing | |
def after_order_processing | |
# This doesn't seem to be called either. Also I would have to check the | |
# current state each time this ran for the 'complete' state | |
binding.pry | |
end | |
end |
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
# app/models/spree/order_decorator.rb | |
Spree::Order.class_eval do | |
# Adding after_transition to state doesn't work | |
state_machine.after_transition to: :complete, | |
do: :after_order_processing | |
def after_order_processing | |
binding.pry | |
end | |
# Aliasing method doesn't work | |
def finalize_with_notify_service! | |
finalize_without_notify_service! | |
binding.pry | |
end | |
alias_method_chain :finalize!, :notify_service! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!