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