javascript - Sequelize setter does not work -
i desperately seek phone call simple setter method seems not exist.
here modeldefinition:
var process = sequelize.mysql.define('process',{ name: sequelize.string, description: sequelize.text, duration: sequelize.bigint, status: { type: sequelize.enum(pstatus.unassigned,pstatus.assigned,pstatus.inprocess,pstatus.stopped,pstatus.finished), defaultvalue: pstatus.unassigned, set: function(v){ console.log('prozess status updated') if(!pstatus.hasownproperty(v)){ homecoming } this.setdatavalue('status',v) } } }
every phone call of process.setstatus(pstatus.inprocess) returns in typeerror
possibly unhandled typeerror: object [object sequelizeinstance] has no method 'setstatus'
what missing here?
setters implemented javascript setters
this means setter invoked when assign property
process.status = 'done' // invokes setter
javascript node.js sequelize.js
No comments:
Post a Comment