mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Merge pull request #494 from tgriesser/fix-tojson
fixes incorrect toJSON extension, for eager loaded models
This commit is contained in:
commit
880de6bde6
1 changed files with 2 additions and 2 deletions
|
@ -35,8 +35,8 @@ GhostBookshelf.Model = GhostBookshelf.Model.extend({
|
|||
return attrs;
|
||||
}
|
||||
|
||||
_.each(relations, function (key) {
|
||||
attrs[key] = relations[key].toJSON();
|
||||
_.each(relations, function (relation, key) {
|
||||
attrs[key] = relation.toJSON ? relation.toJSON() : relation;
|
||||
});
|
||||
|
||||
return attrs;
|
||||
|
|
Loading…
Add table
Reference in a new issue