Skip to content

Instantly share code, notes, and snippets.

@netoneko
Created August 21, 2012 19:55
Show Gist options
  • Save netoneko/3418844 to your computer and use it in GitHub Desktop.
Save netoneko/3418844 to your computer and use it in GitHub Desktop.
Model.delete_all rake task
# coding: utf-8
namespace :db do
desc "usage: models=User,Post"
task :delete_all => :environment do
models = ENV['models'].split(',').collect(&:strip).collect(&:constantize)
models.each &:delete_all
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment