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:
parent
4ea38fc6fc
commit
81c4dea66f
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue