Files
lunchrun.me/api/models/Run.js
2014-04-14 17:25:57 -05:00

37 lines
735 B
JavaScript

/**
* Run
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
name: {
type: 'string',
required: true
},
creatorName: {
type: 'string',
required: true
},
creatorEmail: {
type: 'email',
required: true
},
invitees: {
type: 'array'
},
menuUrl: {
type: 'url'
},
restaurant: 'string'
},
afterCreate: function(values, next) {
EmailService.sendRunEmails(values);
next();
},
};