1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/silencer.rb

27 lines
555 B
Ruby

class Silencer
include AASM
# yes, this line is here on purpose
# by this, we test if overriding configuration options works if
# the state machine is "re-opened"
aasm :whiny_transitions => true
aasm :whiny_transitions => false do
state :silent, :initial => true
state :crying
state :smiling
event :cry do
transitions :from => :silent, :to => :crying
end
event :smile do
transitions :from => :crying, :to => :smiling
end
event :smile_any do
transitions :to => :smiling
end
end
end