mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Write seeds.rb. Closes #356.
However, due to bugs #415 and #416, we are currently unable to seed locations.
This commit is contained in:
parent
532e2ef0a6
commit
4ef4e082ff
45
db/seeds.rb
45
db/seeds.rb
@ -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})
|
||||
Loading…
Reference in New Issue
Block a user