mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
21 lines
415 B
Ruby
21 lines
415 B
Ruby
class DoubleDefiner
|
|
include AASM
|
|
|
|
aasm do
|
|
state :started
|
|
state :finished
|
|
|
|
event :finish do
|
|
transitions :from => :started, :to => :finished
|
|
end
|
|
|
|
# simulating a reload
|
|
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
|