Created
April 18, 2015 10:06
-
-
Save wayne-o/653183531bc78a1a0ec9 to your computer and use it in GitHub Desktop.
With column names
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
/** | |
* ListingEvent.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/#!documentation/models | |
*/ | |
module.exports = { | |
tableName: 'listingEvent', | |
attributes: { | |
name: { type: 'string' }, | |
timeZone: { type: 'string' }, | |
tzOffset: { type: 'string' }, | |
slug: { type: 'string' }, | |
start: { type: 'string' }, | |
end: { type: 'string' }, | |
eventInstanceSlug: { type: 'string' }, | |
location: { | |
model:'location', | |
columnName:'locationId' | |
}, | |
eventInstance: { | |
model:'eventInstance', | |
columnName:'eventInstanceId' | |
}, | |
artist: { | |
model: 'artist', | |
columnName:'artistId' | |
}, | |
users: { | |
collection: 'user', | |
via: 'listingEvents' | |
}, | |
artistSlug: function(){ | |
return this.artists[0].slug; | |
} | |
} | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment