1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/basic_two_state_machines_example.rb
2015-07-20 20:55:47 +12:00

25 lines
505 B
Ruby

class BasicTwoStateMachinesExample
include AASM
aasm :search do
state :initialised, :initial => true
state :queried
state :requested
event :query do
transitions :from => [:initialised, :requested], :to => :queried
end
event :request do
transitions :from => :queried, :to => :requested
end
end
aasm :sync do
state :unsynced, :initial => true
state :synced
event :sync do
transitions :from => :unsynced, :to => :synced
end
end
end