I have set up a simple model with 2 instance methods. How can I call those methods in lifecycle callbacks?
module.exports = {
attributes: {
name: {
type: 'string',
required: true
}
// Instance methods
doSomething: function(cb) {
console.log('Lets try ' + this.doAnotherThing('this'));
cb();
},
doAnotherThing: function(input) {
console.log(input);
}
},
beforeUpdate: function(values, cb) {
// This doesn't seem to work...
this.doSomething(function() {
cb();
})
}
};