UNPKG

sails-hook-blacksails

Version:
40 lines 809 B
module.exports = { attributes: {}, associations() { User.belongsToMany(Role, { through: 'UserRole', foreignKey: { name: 'UserId', as: 'Users', }, }); Role.belongsToMany(User, { through: 'UserRole', foreignKey: { name: 'RoleId', as: 'Roles', }, }); }, options: { "paranoid": false, "timestamps": true, classMethods: { ...sails.config.models.classMethod['UserRole'], associations() { return { "belongsTo": [], "hasMany": [], "hasOne": [], "belongsToMany": [] }; }, }, instanceMethods: { ...sails.config.models.instanceMethod['UserRole'], }, hooks: { ...sails.config.models.hook['UserRole'], }, }, };