Multi-statement transactions with ActiveRecord

All,

Using Rails 1.1.6
AR against MS SQL Server (ODBC mode).

I need to do some fancy bulk inserting of data, which I need to ensure
is within a transaction. But as I think about it, it isn’t clear to me
whether what I want to do will work within standard AR.

Can I do something like this:

MyClass.transaction do
MyClass.connection.execute(“arbitrary SQL”)

end

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