Skip to content

Commit

Permalink
Merge branch 'master' into aasm4
Browse files Browse the repository at this point in the history
  • Loading branch information
alto committed Jan 29, 2014
2 parents 787650f + 8b9ad86 commit d59824a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -94,7 +94,7 @@ class Job
state :sleeping, :initial => true, :before_enter => :do_something
state :running

event :run, :after => Proc.new { |user| notify_somebody(user) } do
event :run, :after => Proc.new { do_afterwards } do
transitions :from => :sleeping, :to => :running, :on_transition => Proc.new {|obj, *args| obj.set_process(*args) }
end

Expand All @@ -117,15 +117,15 @@ class Job
...
end

def notify_somebody(user)
def do_afterwards
...
end

end
```

In this case `do_something` is called before actually entering the state `sleeping`,
while `notify_somebody` is called after the transition `run` (from `sleeping` to `running`)
while `do_afterwards` is called after the transition `run` (from `sleeping` to `running`)
is finished.

Here you can see a list of all possible callbacks, together with their order of calling:
Expand Down

0 comments on commit d59824a

Please sign in to comment.