Hi -- I have a need to run the following SQL in a test: "DELETE FROM agents_bookings" Does anyone know of a way that I can just execute this? It is to clear a many-to-many relationship in the teardown function of a test. Cheers, doug. -- Posted via http://www.ruby-forum.com/.
Havbe a shot at: ActiveRecord::Base.connection.execute("DELETE FROM agents_bookings") HTH, Dan Sketcher www.peoplehub.com.au
Dan Sketcher wrote:> Havbe a shot at: > > ActiveRecord::Base.connection.execute("DELETE FROM agents_bookings") > > HTH, > > Dan Sketcher > www.peoplehub.com.auThat''s perfect, cheers! Works a treat! Thanks, doug. -- Posted via http://www.ruby-forum.com/.