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

Updates 'Callbacks' section example to be correct

The current example is trying to define a before block inside of a
transition block, which is not a supported callback.  Moving the before
block in to the event block for an example that is supported.
This commit is contained in:
Naveed Kakal 2015-08-24 19:06:27 -05:00
parent 4ea38fc6fc
commit 81c4dea66f

View file

@ -99,11 +99,11 @@ class Job
state :running state :running
event :run, :after => :notify_somebody do event :run, :after => :notify_somebody do
transitions :from => :sleeping, :to => :running, :after => Proc.new {|*args| set_process(*args) } do
before do before do
log('Preparing to run') log('Preparing to run')
end end
end
transitions :from => :sleeping, :to => :running, :after => Proc.new {|*args| set_process(*args) }
end end
event :sleep do event :sleep do