Skip to content

Instantly share code, notes, and snippets.

@japel
Created February 25, 2015 12:26
Show Gist options
  • Save japel/7911a72dc68dc17118de to your computer and use it in GitHub Desktop.
Save japel/7911a72dc68dc17118de to your computer and use it in GitHub Desktop.
self referencing many 2 many?
//ModelA
module.exports = {
schema: false,
attributes: {
relationships: {
collection: "ModelB",
via: "rel"
}
}
//ModelB
module.exports = {
schema: false,
tableName: 'modela',
attributes: {
rel: {
collection: "ModelA",
via: "relationships"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment