From 585906d3d4263fc9d3ead9b0cce831c6d6bc16be Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 30 Jun 2010 13:47:26 -0700 Subject: [PATCH] DG IZ; db rake tasks ouput text; delete is now purge --- lib/tasks/db.rake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index af9b5e476..fdcb9c1d3 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -1,12 +1,18 @@ namespace :db do desc 'Seed the current RAILS_ENV database from db/seeds.rb' task :seed do + + puts "Seeding the database for #{RAILS_ENV}..." + require 'db/seeds' end desc 'Delete the collections in the current RAILS_ENV database' - task :delete do + task :purge do require 'config/environment' + + puts "Purging the database for #{RAILS_ENV}..." + # Specifiy what models to remove Post.delete_all Person.delete_all @@ -15,7 +21,10 @@ namespace :db do desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb' task :reset do - Rake::Task['db:delete'].invoke + + puts "Resetting the database for #{RAILS_ENV}".upcase + Rake::Task['db:purge'].invoke Rake::Task['db:seed'].invoke + puts "Success!" end end