# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
require 'faker'

Person.destroy_all
Company.destroy_all


50.times do |n|
	Company.create( name: Faker::Company.name, country_code: Faker::Address.country_code )
end

rand_population = rand(100..500)

rand_population.times do
	Company.find(rand(Company.first.id .. Company.last.id)).people.create( name: Faker::Name.first_name, last_name: Faker::Name.last_name )
end
