Created
August 17, 2009 04:37
-
-
Save alkema/168914 to your computer and use it in GitHub Desktop.
rails 3 rake db:seed for now
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
namespace :db do | |
desc 'Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.' | |
task :reset => [ 'db:drop', 'db:setup' ] | |
desc 'Create the database, load the schema, and initialize with the seed data' | |
task :setup => [ 'db:create', 'db:schema:load', 'db:seed' ] | |
desc 'Load the seed data from db/seeds.rb' | |
task :seed => :environment do | |
seed_file = File.join(Rails.root, 'db', 'seeds.rb') | |
load(seed_file) if File.exist?(seed_file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment