lib/tasks/db_seed_ethnicities.rake
# Seed multiple ethnicities by loading the YAML file
Seed multiple ethnicities by loading the YAML file
Seed multiple ethnicities by loading the YAML file
def db_seed_ethnicities
  path = Rails.root.join('db','seeds','ethnicities.yml')
  File.open(path) do |file|
    YAML.load_stream(file) do |doc|
      doc.keys.each do |group|
        names = doc[group]
        names.each do |name|
          db_seed_ethnicity(group, name)
        end
      end
    end
  end
end
def db_seed_ethnicities path = Rails . root . join ( 'db' , 'seeds' , 'ethnicities.yml' ) File . open ( path ) do | file | YAML . load_stream ( file ) do | doc | doc . keys . each do | group | names = doc [ group ] names . each do | name | db_seed_ethnicity ( group , name ) end end end end end
Seed multiple ethnicities by loading the YAML file
Seed multiple ethnicities by loading the YAML file
# puts "Seeding App Ethnicities from #{path}" # puts "Seeding ethnicity with group #{group}"