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.7.1 db/seeds.rb
hackathon_manager-0.7.0 db/seeds.rb
hackathon_manager-0.6.6 db/seeds.rb
hackathon_manager-0.6.5 db/seeds.rb
hackathon_manager-0.6.4 db/seeds.rb
hackathon_manager-0.6.3 db/seeds.rb
hackathon_manager-0.6.2 db/seeds.rb
hackathon_manager-0.6.1 db/seeds.rb
hackathon_manager-0.6.0 db/seeds.rb
hackathon_manager-0.5.11 db/seeds.rb
hackathon_manager-0.5.10 db/seeds.rb
hackathon_manager-0.5.9 db/seeds.rb
hackathon_manager-0.5.8 db/seeds.rb
hackathon_manager-0.5.7 db/seeds.rb
hackathon_manager-0.5.6 db/seeds.rb
hackathon_manager-0.5.5 db/seeds.rb
hackathon_manager-0.5.4 db/seeds.rb
hackathon_manager-0.5.3 db/seeds.rb
hackathon_manager-0.5.2 db/seeds.rb
hackathon_manager-0.5.1 db/seeds.rb