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

35 lines
520 B
Ruby
Raw Normal View History

class Foo
include AASM
2011-11-26 15:11:57 -05:00
aasm do
state :open, :initial => true, :exit => :exit
state :closed, :enter => :enter
2011-11-26 15:11:57 -05:00
event :close, :success => :success_callback do
transitions :from => [:open], :to => [:closed]
2011-11-26 15:11:57 -05:00
end
2011-11-26 15:11:57 -05:00
event :null do
transitions :from => [:open], :to => :closed, :guard => :always_false
2011-11-26 15:11:57 -05:00
end
end
def always_false
false
end
def success_callback
end
def enter
end
def exit
end
end
class FooTwo < Foo
include AASM
2011-11-26 15:11:57 -05:00
aasm do
state :foo
end
end