Add support for saving graphs of objects #10

Closed
go1dfish opened this Issue Jan 7, 2013 · 4 comments

Projects

None yet

3 participants

@go1dfish
Contributor
go1dfish commented Jan 7, 2013

Suppose you have two models:

Post, Comment Where Post hasMany Comments and Comment belongsTo Post

It should be possible to commit a transaction where both a new Post and Comment are created and related to each other.

Currently this fails as the Comment will attempt to save without an ID.

This could be accomplished by adapter logic to defer portions of the commit until the parent record is saved, or by adding support for saving records in an embedded manner.

Collaborator
ppcano commented Jan 8, 2013

Shouldn't it be an ember-data issue?

Contributor
go1dfish commented Jan 8, 2013

This is planned for ember-data, but will likely still require adapter specific logic, and an adapter implementation is currently recommended for this functionality.

emberjs/data#440

Owner

There is not a generic solution to solve this. I think that until a proposal is given by the ember-data team, the best option is extend the adapter and build that customized feature.

@escalant3 escalant3 closed this Feb 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment