This repository has been archived on 2026-06-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
spellsaurus/api/models/user-model.js
2021-01-20 19:07:56 +01:00

17 lines
394 B
JavaScript

const bookshelf = require('../database/bookshelf').bookshelf;
require('./role-model');
require('./spell-model');
let User = bookshelf.Model.extend({
tableName: 'user',
hidden: ['password', 'role_id'],
role() {
return this.belongsTo('Role');
},
spells() {
return this.hasMany('Spell', 'author_id');
}
});
module.exports = bookshelf.model('User', User);