Skip to content

Instantly share code, notes, and snippets.

@wycats
Created November 18, 2012 18:45
Show Gist options
  • Save wycats/4106771 to your computer and use it in GitHub Desktop.
Save wycats/4106771 to your computer and use it in GitHub Desktop.
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