Sha256: 86602296bf08e6d29498e8c0991d1b2e2cff2c0d0b6e7db00e6c27719fb5e694

Contents?: true

Size: 745 Bytes

Versions: 19

Compression:

Stored size: 745 Bytes

Contents

namespace :db do
  desc "Loads a schema.rb file into the database and then loads the initial database fixtures."
  task :bootstrap => ['db:schema:load', 'db:bootstrap:load']

  namespace :bootstrap do
    desc "Load initial database fixtures (in db/bootstrap/*.yml) into the current environment's database.  Load specific fixtures using FIXTURES=x,y"
    task :load => :environment do
      require 'active_record/fixtures'
      ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
      (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'db', 'bootstrap', '*.{yml,csv}'))).each do |fixture_file|
        Fixtures.create_fixtures('db/bootstrap', File.basename(fixture_file, '.*'))
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
gsterndale-warrant-0.2.0 test/rails_root/lib/tasks/bootstrap.rake
gsterndale-warrant-0.3.0 test/rails_root/lib/tasks/bootstrap.rake
hashrocket-clearance-0.4.0 test/rails_root/lib/tasks/bootstrap.rake
hashrocket-clearance-0.4.1 test/rails_root/lib/tasks/bootstrap.rake
hashrocket-clearance-0.4.2 test/rails_root/lib/tasks/bootstrap.rake
hashrocket-clearance-0.4.3 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.2 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.3 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.4 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.5 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.6 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.7 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.8 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.2.9 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.3.0 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.3.1 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.3.2 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.3.3 test/rails_root/lib/tasks/bootstrap.rake
thoughtbot-clearance-0.3.4 test/rails_root/lib/tasks/bootstrap.rake