Skip to content

Instantly share code, notes, and snippets.

@jackblackCH
Created August 13, 2013 18:26
Show Gist options
  • Save jackblackCH/6224118 to your computer and use it in GitHub Desktop.
Save jackblackCH/6224118 to your computer and use it in GitHub Desktop.
MomentModel
/**
* Moments
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
*
*/
var Waterline = require('waterline');
var Moment = Waterline.Model.extend({
schema: true,
attributes: {
firstName: {
type: 'string',
minLength: 5,
required: true
},
lastName: {
type: 'string',
minLength: 5,
required: true
},
email: {
type: 'string',
required: true
},
/**
* Instance Methods
*/
fullName: function() {
return this.first_name + ' ' + this.last_name;
}
}
});
exports = Moment;
@millien
Copy link

millien commented Aug 13, 2013

{
"createdAt": "2013-08-13T18:28:48.620Z",
"updatedAt": "2013-08-13T18:28:48.620Z",
"id": "520a7ae0234cc1ec08000004"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment