lib/tasks/db_seed_applications.rake
# Seed multiple applications by loading the YAML file
Seed multiple applications by loading the YAML file
Seed multiple applications by loading the YAML file
def db_seed_applications
  path = Rails.root.join('db','seeds','applications.yml')
  File.open(path) do |file|
    YAML.load_stream(file) do |doc|
      doc.keys.sort.each do |key|
        attributes = doc[key]
        db_seed_application(attributes)
      end
    end
  end
end
def db_seed_applications path = Rails . root . join ( 'db' , 'seeds' , 'applications.yml' ) File . open ( path ) do | file | YAML . load_stream ( file ) do | doc | doc . keys . sort . each do | key | attributes = doc [ key ] db_seed_application ( attributes ) end end end end
Seed multiple applications by loading the YAML file
Seed multiple applications by loading the YAML file
# puts "Seeding application structure #{key}"