Load bookshelf plugin model if not apis

This commit is contained in:
Jim Laurie 2017-11-30 13:57:47 +01:00
parent 0655833da9
commit 95607dc7ed
2 changed files with 2 additions and 69 deletions

View File

@ -45,11 +45,6 @@ module.exports = function(strapi) {
// Initialize collections
_.set(strapi, 'bookshelf.collections', {});
// Return callback if there is no model
if (_.isEmpty(strapi.models)) {
return cb();
}
const connections = _.pickBy(strapi.config.connections, {
connector: 'strapi-bookshelf'
});
@ -91,14 +86,6 @@ module.exports = function(strapi) {
_.assign(models, _.pickBy(strapi.models, (model) => model.connection === undefined));
}
// Return callback if there is no model
if (_.isEmpty(models)) {
cb();
// Break the loop.
return false;
}
const loadedHook = _.after(_.size(models), () => {
done();
});

View File

@ -252,34 +252,7 @@
}
},
"application": {
"controllers": {
"article": {
"find": {
"enabled": true,
"policy": ""
},
"findOne": {
"enabled": true,
"policy": ""
},
"create": {
"enabled": true,
"policy": ""
},
"update": {
"enabled": true,
"policy": ""
},
"destroy": {
"enabled": true,
"policy": ""
},
"identity": {
"enabled": true,
"policy": ""
}
}
}
"controllers": {}
}
}
},
@ -536,34 +509,7 @@
}
},
"application": {
"controllers": {
"article": {
"find": {
"enabled": false,
"policy": ""
},
"findOne": {
"enabled": false,
"policy": ""
},
"create": {
"enabled": false,
"policy": ""
},
"update": {
"enabled": false,
"policy": ""
},
"destroy": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
}
}
"controllers": {}
}
}
}