Sha256: f96efc2dea3a5c5c2095e81a1f7edebbac99b37d88246391b24ab11f610ed1cc

Contents?: true

Size: 573 Bytes

Versions: 25

Compression:

Stored size: 573 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_file = File.join(File.dirname(__FILE__), 'schools.csv')
csv_text = File.read(csv_file)
csv = CSV.parse(csv_text, headers: true)
csv.each do |row|
  School.create(row.to_hash)
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hackathon_manager-0.5.0 db/seeds.rb
hackathon_manager-0.4.4 db/seeds.rb
hackathon_manager-0.4.3 db/seeds.rb
hackathon_manager-0.4.2 db/seeds.rb
hackathon_manager-0.4.1 db/seeds.rb