Skip to content

Commit

Permalink
updated the README to reflect success callback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
code-later committed Nov 23, 2011
1 parent e0b886b commit b560f20
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.rdoc
Expand Up @@ -95,6 +95,13 @@ In case you need to trigger a method call after a successful transition you can
transitions :to => :discontinued, :from => [:available, :out_of_stock]
end

In addition to just specify the method name on the record as a symbol you can pass a lambda to
perfom some more complex success callbacks:

event :discontinue, :success => lambda { |order) AdminNotifier.notify_about_discontinued_order(order) } do
transitions :to => :discontinued, :from => [:available, :out_of_stock]
end

== Timestamps

If you'd like to note the time of a state change, Transitions comes with timestamps free!
Expand Down

0 comments on commit b560f20

Please sign in to comment.