makandra / active_type

Make any Ruby object quack like ActiveRecord
MIT License
1.09k stars 74 forks source link

Fix after_commit callbacks for ActiveType::Object on Rails 4 #57

Closed mattbrictson closed 8 years ago

mattbrictson commented 8 years ago

Fixes #47.

In order to test an after_commit hook, the test can't be run within a transaction wrapper, which by default is being applied to all RSpec examples. To work around this, I added a :rollback => false RSpec metadata to disable the wrapper on a per-example basis.

For ActiveType::Object, it is OK to commit the transaction, because there is no backing table that will affected.