redding/mr — pull request #8 by kellyredding (2013-04-09 23:14:03+00:00)
Title: Add transaction callbacks

WIP: this will add the following callbacks:

* `{before|after}_transaction`
* `{before|after}_transaction_on_create`
* `{before|after}_transaction_on_update`
* `{before|after}_transaction_on_destroy`

In addition, it updates the `destroy` method to run in a transaction. All this came about b/c I noticed the `destroy` method wasn't wrapping all its callbacks in a transaction like `save` was. I then noticed that there were no tests to test that these methods were using transactions. Then I noticed there was no way to reliably test that unless you had callbacks and could test that callbacks were being fired. Thus this PR and all those things wrapped up in it.

Hopefully the commits will tell the story in a sane fashion.