Sha256: 5fc58a07d81437e8e7105c533bc03f9c6957b178663ae30c983cac3a9d4bb1ae

Contents?: true

Size: 521 Bytes

Versions: 7

Compression:

Stored size: 521 Bytes

Contents

# 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 'csv'

puts "Seeding school list..."

csv_text = File.read('db/schools.csv')
csv = CSV.parse(csv_text, headers: true)
csv.each do |row|
  School.create(row.to_hash)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hackathon_manager-0.4.0 db/seeds.rb
hackathon_manager-0.3.3 db/seeds.rb
hackathon_manager-0.3.2 db/seeds.rb
hackathon_manager-0.3.1 db/seeds.rb
hackathon_manager-0.3.0 db/seeds.rb
hackathon_manager-0.2.0 db/seeds.rb
hackathon_manager-0.1.0 db/seeds.rb