From a9342841fac3aa3fdcde71469af3c2e1d2725f46 Mon Sep 17 00:00:00 2001 From: Intrepidd Date: Tue, 19 Nov 2013 19:58:10 +0100 Subject: [PATCH] Add README changes for pull request #90 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a3a5399..3fff45f 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,15 @@ job.may_run? # => false job.run # => false ``` +When firing an event, you can pass a block to the method, it will be called only if +the transition succeeds : + +```ruby + job.run do + job.user.notify_job_ran # Will be called if job.may_run? is true + end +``` + ### Callbacks You can define a number of callbacks for your transitions. These methods will be