Rollback fails with sqlite3

The ActiveRecord::Transaction does not work with sqlite3?

I try the next code.

  User.transaction do
    User.create!(:email => "foo")
    User.create!()
  end

The User should have the email field, and others are optional.
I expect this code creates no User entry on db (because the second
creation fails –
this is checked with catching the Exception outside of the transaction
block),
but User.count is 1 (I am sure that User.count is 0 before executing
this).

Do I misunderstand the notion of transaction? or Do I make some
mistake?

Thanks in advance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs