rails/rails — pull request #5535 by markmcspadden (2012-03-21 08:48:14+00:00)
Title: Allow manual rollbacks in after_save to reset object correctly

Started digging into #5527 and was at least able to confirm the case was happening in the given situation, find what was causing it, and write some tests to further confirm it and the fix.

Now...I don't really pretend to know if actually fixing this is a good idea or not. The example raises `ActiveRecord::Rollback` in an `after_save` hook. I can't find any examples that this is actually a good idea in the first place.

I'm also not keen on where I added the tests or the actual solution....so all around an iffy PR. But all the tests pass...so that's something.

It's my first dive into AR::Transactions, so if this is a bad idea, close the PR and no love lost. If it just needs some cleanup, let me know where to start.