Permalink
Browse files

updated the README to reflect success callback changes

  • Loading branch information...
1 parent e0b886b commit b560f206179d89ddbea80954d2d0cb50d840c7a0 @railsbros-dirk railsbros-dirk committed Nov 23, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 README.rdoc
View
7 README.rdoc
@@ -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!

0 comments on commit b560f20

Please sign in to comment.