Add requireFetch false to all bookshelf models

This commit is contained in:
Alexandre Bodin 2019-10-25 10:12:35 +02:00
parent 380681ccd1
commit ae3f421737
2 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ const createGroupModels = async ({ model, definition, ORM, GLOBALS }) => {
const joinTable = `${collectionName}_groups`;
const joinColumn = `${pluralize.singular(collectionName)}_${primaryKey}`;
const joinModel = ORM.Model.extend({
requireFetch: false,
tableName: joinTable,
group() {
return this.morphTo(

View File

@ -382,6 +382,7 @@ module.exports = ({ models, target, plugin = false }, ctx) => {
// Define new model.
const options = {
requireFetch: false,
tableName: `${definition.collectionName}_morph`,
[definition.collectionName]: function() {
return this.belongsTo(