Created
January 9, 2011 22:56
-
-
Save opsb/772117 to your computer and use it in GitHub Desktop.
Redefine db:test:purge task to clear database instead of drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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