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

47 lines
607 B
Ruby
Raw Normal View History

class SuperClass
2013-04-21 12:43:03 -04:00
include AASM
aasm do
state :read
state :ended
event :foo do
transitions :to => :ended, :from => [:read]
end
end
def update_state
if may_foo?
foo!
end
end
2013-04-21 12:43:03 -04:00
end
class SuperClassMultiple
include AASM
aasm(:left) do
state :read
state :ended
event :foo do
transitions :to => :ended, :from => [:read]
end
end
aasm(:right) do
state :opened
state :closed
event :close do
transitions :to => :closed, :from => [:opened]
end
end
def update_state
if may_foo?
foo!
end
end
end