Skip to content

Instantly share code, notes, and snippets.

@tddium
Created December 25, 2011 21:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tddium/1519804 to your computer and use it in GitHub Desktop.
Save tddium/1519804 to your computer and use it in GitHub Desktop.
Example tddium db hook
# Copyright (c) 2011 Solano Labs All Rights Reserved
# lib/tasks/tddium.rake
namespace :tddium do
desc "default tddium environment db setup task"
task :db_hook do
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