Skip to content

Instantly share code, notes, and snippets.

@alkema
Created August 17, 2009 04:37
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 alkema/168914 to your computer and use it in GitHub Desktop.
Save alkema/168914 to your computer and use it in GitHub Desktop.
rails 3 rake db:seed for now
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