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:
parent
a2e670cb0b
commit
8997cd0ffc
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue