dimanche 17 janvier 2016

Rails Console Deletion using Where Condition

In my Rail app from Rails Console I want to delete Customers whose creater_id = some id like bellow:

Customer.where(creater_id: 5).delete_all

What is the best method to delete using rails condition based on a specific condition using "where" ?

Aucun commentaire:

Enregistrer un commentaire