diff --git a/ghost/core/core/server/models/base/plugins/raw-knex.js b/ghost/core/core/server/models/base/plugins/raw-knex.js index ffdf38fadd6c..30e76e4d9968 100644 --- a/ghost/core/core/server/models/base/plugins/raw-knex.js +++ b/ghost/core/core/server/models/base/plugins/raw-knex.js @@ -1,7 +1,6 @@ const _ = require('lodash'); const debug = require('@tryghost/debug')('models:base:raw-knex'); const plugins = require('@tryghost/bookshelf-plugins'); -const Promise = require('bluebird'); const schema = require('../../../data/schema'); @@ -166,10 +165,12 @@ module.exports = function (Bookshelf) { })(); }); - return Promise.props(props) - .then((relationsToAttach) => { + return Promise.all(Object.values(props)) + .then((relationsToAttachArray) => { debug('attach relations', modelName); + const relationsToAttach = _.zipObject(_.keys(props), relationsToAttachArray); + objects = _.map(objects, (object) => { _.each(Object.keys(relationsToAttach), (relation) => { if (!relationsToAttach[relation][object.id]) { diff --git a/ghost/core/package.json b/ghost/core/package.json index 0004c1f853e5..0a20d5b42951 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -163,7 +163,6 @@ "@tryghost/zip": "1.1.37", "amperize": "0.6.1", "analytics-node": "6.2.0", - "bluebird": "3.7.2", "body-parser": "1.20.2", "bookshelf": "1.2.0", "bookshelf-relations": "2.6.0",