Skip to content

Instantly share code, notes, and snippets.

@efigarolam
Last active December 21, 2015 20:09
Show Gist options
  • Save efigarolam/6359707 to your computer and use it in GitHub Desktop.
Save efigarolam/6359707 to your computer and use it in GitHub Desktop.
Seed file for EmberBlog application.
users = User.create([
{
name: 'Your name',
last_name: 'Your last name',
email: 'your@email.com',
admin: true,
active: true
}
])
posts = Post.create([
{
author: users.first,
title: 'Test 1',
content: 'Hello World',
status: 'published'
},
{
author: users.first,
title: 'Test 2',
content: 'Hello World 2',
status: 'draft'
},
{
author: users.first,
title: 'Test 3',
content: 'Hello World 3',
status: 'published'
},
])
comments = Comment.create([
{
user: users.first,
post: posts.first,
content: 'Hello World',
status: 'published'
},
{
user: users.first,
post: posts.first,
content: 'Hello World 2',
status: 'published'
},
{
user: users.first,
post: posts.last,
content: 'Hello World 3',
status: 'published'
},
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment