I want to clear a table in my railsapp , without dropping the database and migrating...
MyModel.all.each{|m| m.destroy}
I would expect this code to delete every record in the my_model table, but this is not happening... using Rails 2.3.4 + MySQL 5.1
EDIT: the issue was based on the plugin better_nested_set which didn't allow me to delete the entries in that order
MyModel.delete_all
worked on the other hand , maybe because it executes truncate on the database (?)