Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
Created May 21, 2015 13:25
Show Gist options
  • Save yannbertrand/4a7a054fbe2b8dbe9ed4 to your computer and use it in GitHub Desktop.
Save yannbertrand/4a7a054fbe2b8dbe9ed4 to your computer and use it in GitHub Desktop.
Example models
module.exports = {
attributes: {
title: {
type: 'text'
},
content: {
type: 'text'
},
comments: {
collection: 'comment',
via: 'article'
}
}
};
module.exports = {
attributes: {
user: {
model: 'User',
required: true
},
article: {
model: 'Article',
required: true
},
content: {
type: 'text'
}
}
};
module.exports = {
attributes: {
username: {
type: 'text'
},
comments: {
collection: 'comment',
via: 'user'
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment