Bootstraping your database with rake

Tagged bootstrap, ruby, rails, rake  Languages ruby

In lib/tasks/app.rake:

namespace :db do
  desc "Bootstraps the database"
  task :bootstrap => ['db:schema:load'] do

   { 'Ruby' => 'ruby',
      'JavaScript' => 'javascript',
    }.each do |name, short_name|
      Category.create!(:name => name, :short_name => short_name)
    end

  end
end