Merge pull request #315 from wvengen/feature/db_seeds

more extensive database seeds (in two languages)
This commit is contained in:
wvengen 2014-10-16 20:43:11 +02:00
commit c585f53f54
7 changed files with 444 additions and 27 deletions

16
lib/tasks/seeds.rake Normal file
View file

@ -0,0 +1,16 @@
# Allow loading multiple seeds
# Tried using seedbank, but that supposes all seeds are loaded, while
# we want to have different options to choose from (and they can't
# be loaded at the same time).
require 'pathname'
namespace :db do
namespace :seed do
Dir.glob(Rails.root.join('db/seeds/*.seeds.rb')).each do |seedfile|
desc "Load the seed data from #{Pathname.new(seedfile).relative_path_from(Rails.root)}"
task File.basename(seedfile, '.seeds.rb') => :environment do
require_relative seedfile
end
end
end
end