Sequelize Model.prototype.(customFunction) not working
问题 I am trying to define a customFunction in Sequelize model. But I get an error : TypeError: user.getJWT is not a function at User.create.then (/projects/test/a/app/controllers/UserController.js:22:29) Here is the code of models/user.js : module.exports = function(sequelize, Sequelize) { var User = sequelize.define('User', { id: { type: Sequelize.INTEGER(11), allowNull: true, primaryKey: true, autoIncrement: true }, user_id: { type: Sequelize.STRING(255), allowNull: true, defaultValue: '' } });