2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Do not eagerly fetch relations in when finding all posts

fixes #4232
- do not fetch tags and fields relations in post.findAll()
This commit is contained in:
Mattias Cibien 2014-11-12 17:12:01 +01:00
parent a2e670cb0b
commit 8997cd0ffc

View file

@ -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);
},