Sha256: a6578737f17c787ab4ae5f67f175455034e26b570ffafb33793ee72b93e81fd7

Contents?: true

Size: 875 Bytes

Versions: 3

Compression:

Stored size: 875 Bytes

Contents

namespace :db do

  desc 'Drops all the collections for the database for the current Rails.env'
  task :drop => :environment do
    Mongoid.master.collections.each{|col| col.drop unless col.name == 'system.users' }
  end

  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

  desc 'Create the database, and initialize with the seed data'
  task :setup => [ 'db:create', 'db:seed' ]

  desc 'Delete data and seed'
  task :reseed => [ 'db:drop', 'db:seed' ]

  task :create => :environment do
    # noop
  end

  task :migrate => :environment do
    # noop
  end

  namespace :schema do
    task :load do
      # noop
    end
  end

  ########
  # TODO: lots more useful db tasks can be added here. stuff like copyDatabase, etc
  ########
end

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
chhean-mongoid-2.0.1.beta1 lib/mongoid/railties/database.rake
mongoid-2.0.0.beta.5 lib/mongoid/railties/database.rake
mongo_thing-0.0.1 lib/mongo_thing/railties/database.rake