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-18 22:06:36 +01:00

18 lines
413 B
JavaScript

'use strict'
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 )