Patch to ActiveRecord transactions

ActiveRecord has a bug and and couple of inconsistencies when rolling back multistatement transactions. There is a patch to fix the issues at #2991 After Transaction Patch - Ruby on Rails - rails