I use state machine gem called AASM on rails.
There are an event which has two types of transitions.
Three three types of state
state pending
state past_due
state paid
pending
can be changed into paid
past_due
can be changed into paid
event :pay do
transitions from: [:pending, :past_due], to: :paid
end
So here I'd love to do some action only if past_due
goes paid
.
Any idea?