Permalink
Browse files

Update README to mention block passing when using run_after_commit.

  • Loading branch information...
1 parent ca3b912 commit 46de30f5c89bfc0479109fd9d4c81649011d1b49 @tism tism committed Jul 30, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 README.md
View
@@ -19,7 +19,7 @@ gem 'after_commit_queue'
### Usage
-Include AfterCommitQueue module in your ActiveRecord model and you're ready to go.
+Include AfterCommitQueue module in your ActiveRecord model and you're ready to go. When registering a hook with run_after_commit you can supply either a method symbol or a block. No parameter is supplied when using the block form.
```ruby
class Server < ActiveRecord::Base
@@ -41,7 +41,9 @@ class Server < ActiveRecord::Base
end
def schedule_stop
- run_after_commit(:stop_server)
+ run_after_commit do
+ stop_server
+ end
end
def start_server; @started = true end

0 comments on commit 46de30f

Please sign in to comment.