Open ryanzec opened 10 years ago
Thinking about this more, since toJSONWithRelationships()
returns a promise (since the relationship might not be loaded as the time of calling) we really can't combine them. From what I am seeing, toJSON()
should be returning a regular value and toJSONWithRelationships()
needs to return a promise.
Eager loading is something that needs to be looked at and if it is implemented, toJSON() should should probably include any relationships that have been loaded (with options to manage this). Will keep this open until eager loading is looked at.
There is no real reason we should not be able to combine
toJSON()
andtoJSONWithRelationships()
to one configurable method call.