How do I go about calling a method on state change in AASM?
I’d like to call update_foo when the state transitions to paid in the following model:
class Foo < ActiveRecord::Base include AASM # State Machine aasm_initial_state :incomplete aasm_state :incomplete aasm_state :paid aasm_event :pay do transitions :from => :incomplete, :to => :paid end def update_foo ... end end
Nevermind – figured it out: