pat / after_commit

A Ruby on Rails plugin to add an after_commit callback. This can be used to trigger things only after the entire transaction is complete.
MIT License
62 stars 32 forks source link

rescue should be "rescue Exception => e" in release_savepoint_with_callback to be consistent with activerecord #2

Closed walleyemi closed 13 years ago

walleyemi commented 13 years ago

I've only experienced this with activerecord 2.3.11, so perhaps it's only recently been introduced.

The ol' rescue only catches StandardError and children issue. Unfortunately, the begin/rescue around active record transactions explicity catches Exception descendent classes, which means an exception not descending from StandardError (i.e. the ones thrown by mocha) will create an inconsistency between after_callback and activerecord.

pat commented 13 years ago

Thanks for that, just merged it in :)