Issuing raw SQL in Rails

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.

Havbe a shot at:

ActiveRecord::Base.connection.execute(“DELETE FROM agents_bookings”)

HTH,

Dan S.
www.peoplehub.com.au

Dan S. wrote:

Havbe a shot at:

ActiveRecord::Base.connection.execute(“DELETE FROM agents_bookings”)

HTH,

Dan S.
www.peoplehub.com.au

That’s perfect, cheers!
Works a treat!
Thanks,
doug.