Sha256: 55f7f5ccac8ecd93df838a34a75a93f456867f34d33fec33428035fcc05d5390

Contents?: true

Size: 1010 Bytes

Versions: 3

Compression:

Stored size: 1010 Bytes

Contents

namespace :hatchy do 
  
  desc "Load seed data for Hatchy Engine"
    task :seed => :environment do
      require File.join(Hatchy.root, 'db', 'seed')
    end

  desc "Import default set of countries"
    task :import_countries => :environment do
      Hatchy::CountryImporter.import
    end

  desc "Create a default admin user"
    task :create_admin_user => :environment do 
      Hatchy::User.create(email:'admin@example.com', password:'password', password_confirmation:'password', first_name:'Default', last_name:'Admin', admin: true)
      puts "    New user has been created successfully."
      puts
      puts "    E-Mail Address..: admin@example.com"
      puts "    Password........: password"
    end

  desc "Run the setup task for a new application"
    task :setup => :environment do
      Rake::Task["hatchy:seed"].invoke
      Rake::Task["hatchy:import_countries"].invoke if Hatchy::Country.all.empty?
      Rake::Task["hatchy:create_admin_user"].invoke if Hatchy::User.all.empty?
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hatchy-0.0.8.pre lib/tasks/hatchy_tasks.rake
hatchy-0.0.7.pre lib/tasks/hatchy_tasks.rake
hatchy-0.0.6.pre lib/tasks/hatchy_tasks.rake