mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
19 lines
346 B
Ruby
19 lines
346 B
Ruby
|
class GuardianWithoutFromSpecified
|
||
|
include AASM
|
||
|
|
||
|
aasm do
|
||
|
state :alpha, :initial => true
|
||
|
state :beta
|
||
|
state :gamma
|
||
|
|
||
|
event :use_guards_where_the_first_fails do
|
||
|
transitions :to => :beta, :guard => :fail
|
||
|
transitions :to => :gamma, :guard => :succeed
|
||
|
end
|
||
|
end
|
||
|
|
||
|
|
||
|
def fail; false; end
|
||
|
def succeed; true; end
|
||
|
end
|