Hello!
According to ActiveRecord transactions documentation,
User.transaction do User.create(:username => 'Kotori') User.transaction(:requires_new => true) do User.create(:username => 'Nemu') raise ActiveRecord::Rollback end end
User.find(:all) # => Returns only Kotori
But I get both records in database (tested on PostgreSQL and MySQL). In this case:
User.transaction do User.create(:username => 'Kotori') User.transaction(:requires_new => true) do User.create(:username => 'Nemu') raise 'something' # ActiveRecord::Rollback end end
everything seems to be okay.
Also, in cases/transactions_test.rb there is no test for raising AR::Rollback, only for generic raise.