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.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.