Created
November 18, 2012 18:45
-
-
Save wycats/4106771 to your computer and use it in GitHub Desktop.
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
module Post { | |
import Comment from Comment; | |
import Model from DS; | |
class Post extends Model {} | |
Post.schema((post) => { | |
post.attr('title'); | |
post.attr('body'); | |
post.hasMany('comments', Comment); | |
}) | |
export Post; | |
} | |
module Comment { | |
import Post from Post; | |
import Model from DS; | |
class Comment extends Model {} | |
Comment.schema((comment) => { | |
comment.attr('body'); | |
comment.belongsTo('post', Post); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment