Added getSpellsFromUser() method
This commit is contained in:
@@ -7,14 +7,18 @@ require('./ingredient-model')
|
||||
|
||||
let Spell = bookshelf.Model.extend({
|
||||
tableName: 'spell',
|
||||
hidden: [ 'author_id' ],
|
||||
author() {
|
||||
return this.belongsTo( 'User', 'author_id' );
|
||||
},
|
||||
schools() {
|
||||
return this.belongsToMany( 'School', 'spell_school' )
|
||||
return this.belongsToMany( 'School', 'spell_school' );
|
||||
},
|
||||
variables() {
|
||||
return this.belongsToMany( 'Variable', 'spell_variable' )
|
||||
return this.belongsToMany( 'Variable', 'spell_variable' );
|
||||
},
|
||||
ingredients() {
|
||||
return this.belongsToMany( 'Ingredient', 'spell_ingredient' )
|
||||
return this.belongsToMany( 'Ingredient', 'spell_ingredient' );
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user