1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/guardian_without_from_specified.rb
2017-04-27 15:52:54 +05:30

18 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