Created
September 13, 2015 23:33
-
-
Save gaboelnuevo/7b48ea763a3665f0abfa to your computer and use it in GitHub Desktop.
mixin: timestamp loopback
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
module.exports = function(Model, options) { | |
// Model is the model class | |
// options is an object containing the config properties from model definition | |
Model.defineProperty('created', {type: Date, default: '$now'}); | |
Model.defineProperty('modified', {type: Date, default: '$now'}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment