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-01 22:07:22 +01:00

18 lines
400 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() {
return this.belongsTo( 'Role' );
},
spells() {
return this.hasMany( 'Spell', 'author_id' );
}
})
module.exports = bookshelf.model('User', User)