Write seeds.rb. Closes #356.

However, due to bugs #415 and #416, we are currently unable to seed locations.
This commit is contained in:
Robert Richter 2015-03-22 16:12:20 -05:00
parent 532e2ef0a6
commit 4ef4e082ff

View File

@ -1,7 +1,38 @@
# 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)
# ruby encoding: utf-8
tolkien = User.create({
:name => 'JRRTolkien',
:email => 'tolkien@example.com',
:password => 'Mellon'})
middleearth = Universe.create({
:name => 'Middle-Earth',
:user => tolkien,
:privacy => 'public'})
frodo = Character.create({
:name => 'Frodo Baggins',
:user => tolkien,
:universe => middleearth,
:age => '50'})
sting = Equipment.create({
:name => 'Sting',
:user => tolkien,
:universe => middleearth})
# Issues #415 and #416 prevent us from seeding locations
#shire = Location.create({
# :name => 'The Shire',
# :user => tolkien,
# :universe => middleearth})
sindarin = Language.create({
:name => 'Sindarin',
:user => tolkien,
:universe => middleearth})
wizard = Magic.create({
:name => 'Wizard Magic',
:user => tolkien,
:universe => middleearth})