fphilipe/ar_after_transaction — comment on commit 8cdbe8a58c59193be21f9e85274a8754d50b1644
File:  line 0
By fphilipe:

Hey, I was meaning to file a bug. This was a hotfix for an error in a production app that was happening inside a transaction block:

```ruby
@record.transaction do
@record.save!
@record.do_something_else
end
```

The error was:

```
ArgumentError: wrong number of arguments (1 for 0)
from /app/vendor/bundle/ruby/1.9.1/gems/ar_after_transaction-0.2.1/lib/ar_after_transaction.rb:13:in `transaction'
from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:232:in `transaction'
from (irb):174
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:40:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
```

The [transaction method](https://github.com/rails/rails/blob/6ad8f6ef5cd8b31b0f89728fabb52f415bd303ff/activerecord/lib/active_record/transactions.rb#L231) in AR 3.1.1:

```ruby
def transaction(options = {}, &block)
self.class.transaction(options, &block)
end
```

The option was introduced in rails/rails/69789c3b29b9ee0b89928f4211060f470d0e0c44.

Apart from that your gem is working great. We use it mainly to make sure that Resque jobs are enqueued after commit.