Created
June 23, 2011 06:17
-
-
Save semipermeable/1042008 to your computer and use it in GitHub Desktop.
tddium:db_hook example
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
# lib/tasks/tddium.rake | |
namespace :tddium do | |
desc "tddium environment db setup task" | |
task :db_hook do | |
ENV['RAILS_ENV'] = 'test' | |
Rake::Task["db:create"].invoke | |
if File.exists?(File.join(Rails.root, "db", "schema.rb")) | |
Rake::Task['db:schema:load'].invoke | |
else | |
Rake::Task['db:migrate'].invoke | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment