Created
August 13, 2013 18:26
-
-
Save jackblackCH/6224118 to your computer and use it in GitHub Desktop.
MomentModel
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
/** | |
* 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{
"createdAt": "2013-08-13T18:28:48.620Z",
"updatedAt": "2013-08-13T18:28:48.620Z",
"id": "520a7ae0234cc1ec08000004"
}