3 const customUsersValidators = require('../helpers/custom-validators').users
5 module.exports = function (sequelize, DataTypes) {
6 const Author = sequelize.define('Author',
9 type: DataTypes.STRING,
12 usernameValid: function (value) {
13 const res = customUsersValidators.isUserUsernameValid(value)
14 if (res === false) throw new Error('Username is not valid.')
37 // ---------------------------------------------------------------------------
39 function associate (models) {
40 this.belongsTo(models.Pod, {