Skip to content

Instantly share code, notes, and snippets.

@opsb
Created January 9, 2011 22:56
Show Gist options
  • Save opsb/772117 to your computer and use it in GitHub Desktop.
Save opsb/772117 to your computer and use it in GitHub Desktop.
Redefine db:test:purge task to clear database instead of drop
Rake::TaskManager.class_eval do
def delete_task(task_name)
@tasks.delete(task_name.to_s)
end
Rake.application.delete_task("db:test:purge")
end
namespace :db do
namespace :test do
task :purge do
ActiveRecord::Migrator.migrate("db/migrate/", 0)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment