-
-
Save samth/4106878 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; | |
export get Post() { return _Post; } | |
class _Post extends Model {} | |
_Post.schema((post) => { | |
post.attr('title'); | |
post.attr('body'); | |
post.hasMany('comments', Comment); | |
}) | |
} | |
module Comment { | |
import Post from Post; | |
import Model from DS; | |
export 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