From 8997cd0ffcd17b7a7d0f32f0ecde788272b8d79d Mon Sep 17 00:00:00 2001 From: Mattias Cibien Date: Wed, 12 Nov 2014 17:12:01 +0100 Subject: [PATCH] Do not eagerly fetch relations in when finding all posts fixes #4232 - do not fetch tags and fields relations in post.findAll() --- core/server/models/post.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/server/models/post.js b/core/server/models/post.js index ae1ae4d7ce..55eebf9bea 100644 --- a/core/server/models/post.js +++ b/core/server/models/post.js @@ -248,7 +248,9 @@ Post = ghostBookshelf.Model.extend({ */ findAll: function (options) { options = options || {}; - options.withRelated = _.union(['tags', 'fields'], options.include); + + // fetch relations passed to options.include + options.withRelated = options.include; return ghostBookshelf.Model.findAll.call(this, options); },