Closed detournemint closed 9 years ago
If i'm not wrong you need to do
state_machine :state, initial: :unapproved do
event :reject_it do
transition [:approved, :unapproved] => :rejected
end
after_transition [:approved, :unapproved] => :rejected do |rejected_purchase_request, _|
PurchaseRequestsMailer.purchase_request_rejected(rejected_purchase_request).send
end
end
That does it, thank you!
Sorry if this is in the wrong place.
I have the following state machine and I'm trying to send an email after the state changes:
My problem is that self refers to the statemachine object, not the object that is calling the state machine, is there anyway to access that object that's calling the state machine?