Fix conflict

This commit is contained in:
cyril lopez 2017-12-13 16:47:35 +01:00
commit b541e6cc4f
3 changed files with 6 additions and 4 deletions

View File

@ -36,7 +36,7 @@ module.exports = {
} catch (e) {
// Collection undefined try to get the collection based on collectionIdentity
if (typeof strapi !== 'undefined') {
collection = _.get(strapi.bookshelf.collections, collectionIdentity);
collection = _.get(strapi, `bookshelf.collections.${collectionIdentity}`);
}
// Impossible to match collectionIdentity before, try to use idAttribute

View File

@ -211,6 +211,7 @@ module.exports = {
switch (association.nature) {
case 'oneToOne':
case 'oneToMany':
case 'manyToOne':
return module.exports.update.call(this, params);
case 'manyToMany':
return this.forge({
@ -233,6 +234,7 @@ module.exports = {
switch (association.nature) {
case 'oneToOne':
case 'oneToMany':
case 'manyToOne':
return module.exports.update.call(this, params);
case 'manyToMany':
return this.forge({