Sha256: 6dca45ce05d7ca322b89ac84706bf08467c27693e8dbd8d04d27c49c98eda89d

Contents?: true

Size: 607 Bytes

Versions: 5

Compression:

Stored size: 607 Bytes

Contents

namespace :db do
  # * define a helper to have the methods included in the seeds files directly
  # * additionally to the normal rails seeds, the production seeds are also
  #   included
  desc 'Load the seed data from db/seeds.production.rb'
  task seed: [:seed_helper, :'seed:production']

  namespace :seed do
    desc 'Load the seed data from db/seeds.production.rb'
    task production: [:environment, :seed_helper] do
      file = Rails.root.join('db/seeds.production.rb')
      load file if File.exist?(file)
    end
  end

  task :seed_helper do
    require 'seed_box'
    include SeedBox
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
seed_box-0.4.0 lib/tasks/seed_box.rake
seed_box-0.3.0 lib/tasks/seed_box.rake
seed_box-0.2.1 lib/tasks/seed_box.rake
seed_box-0.2.0 lib/tasks/seed_box.rake
seed_box-0.1.0 lib/tasks/seed_box.rake