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.
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs