- Moved api files to a relevant subfolder
This commit is contained in:
21
api/models/spell-model.js
Normal file
21
api/models/spell-model.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict'
|
||||
const bookshelf = require('../database/bookshelf').bookshelf
|
||||
|
||||
require('./school-model')
|
||||
require('./variable-model')
|
||||
require('./ingredient-model')
|
||||
|
||||
let Spell = bookshelf.Model.extend({
|
||||
tableName: 'spell',
|
||||
schools() {
|
||||
return this.belongsToMany( 'School', 'spell_school' )
|
||||
},
|
||||
variables() {
|
||||
return this.belongsToMany( 'Variable', 'spell_variable' )
|
||||
},
|
||||
ingredients() {
|
||||
return this.belongsToMany( 'Ingredient', 'spell_ingredient' )
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = bookshelf.model('Spell', Spell)
|
||||
Reference in New Issue
Block a user