Skip to content

Instantly share code, notes, and snippets.

@dennismonsewicz
Created April 6, 2012 13:06
Show Gist options
  • Save dennismonsewicz/2319588 to your computer and use it in GitHub Desktop.
Save dennismonsewicz/2319588 to your computer and use it in GitHub Desktop.
Easy way to run delete_all on all database tables when running a seed file
Dir["../app/models/*.rb"].each do |file|
File.basename(file, ".rb").capitalize.delete_all
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment