Skip to content

Instantly share code, notes, and snippets.

@DisruptiveMind
Created December 1, 2014 15:36
Show Gist options
  • Select an option

  • Save DisruptiveMind/1ecc0f28c43a9a679af2 to your computer and use it in GitHub Desktop.

Select an option

Save DisruptiveMind/1ecc0f28c43a9a679af2 to your computer and use it in GitHub Desktop.
SailsJS/Waterline Collection with custom data?
AssetPackage = {
schema: true,
attributes: {
name: {
type: 'string',
required: true
},
assets: {
collection: 'Asset',
via: 'pack'
},
// Planning to put array of assets' CustomData here
/*
assetData: [
{asset: INDEX_OF_ASSETS, data: {...}}
]
*/
}
Asset = {
schema: true,
attributes: {
name: {
type: 'string',
required: true
},
pack: {
model: 'AssetPackage'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment