Last active
December 21, 2015 20:09
-
-
Save efigarolam/6359707 to your computer and use it in GitHub Desktop.
Seed file for EmberBlog application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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