mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
20 lines
344 B
Ruby
20 lines
344 B
Ruby
class StateMachineWithFailedEvent
|
|
include AASM
|
|
|
|
aasm do
|
|
state :init, :initial => true
|
|
state :failed
|
|
state :sent
|
|
|
|
event :failed do
|
|
transitions :from => :init, :to => :failed
|
|
end
|
|
event :send, :before => :callback do
|
|
transitions :from => :init, :to => :sent
|
|
end
|
|
end
|
|
|
|
def callback
|
|
true
|
|
end
|
|
end
|