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

22 lines
415 B
Ruby
Raw Normal View History

class DoubleDefiner
include AASM
aasm do
state :started
state :finished
event :finish do
transitions :from => :started, :to => :finished
end
# simulating a reload
2014-09-09 17:02:11 -04:00
state :finished, :before_enter => :do_enter
event :finish do
transitions :from => :started, :to => :finished, :after => :do_on_transition
end
end
def do_enter; end
def do_on_transition; end
end