Uh oh!
There was an error while loading. Please reload this page.
Add support for nested saves - #173
Conversation
- small editing - expand "scenario solving"
sandstrom
commented
Oct 21, 2016
@hjdivad@igorT I'm thrilled to see this RFC! 🏅 Of all open issues in Ember Data this is the one with the most comments (not counting duplicates). So it's definitely something that would bring joy to a huge amount of Ember Data users! Some thoughts:
Your question: “Are there issues with transitioning nested saved objects to an invalid state even in cases where the nested object itself did not have errors?” I don't see any problem with this. |
hjdivad
commented
Oct 21, 2016
Although both
After some discussion, this RFC will be reworked slightly to move
Yes. Your serializer will need to ensure that |
sandstrom
commented
Oct 21, 2016
@hjdivad I was mainly throwing the idea out there (id-naming). If you prefer Moving |
mspisars
commented
May 17, 2017
Is there a timeline for this? Can this be brought up for discussion on being added to the timeline? |
robneville73
commented
Oct 23, 2017
is anyone working on this? I might be interested in tackling some of this. |
hjdivad
commented
Oct 30, 2017
@robneville73 nobody is working on it at the moment, but everyone's pretty positive on the idea. The first step is to rework the rfc (slightly) to make the mechanics entirely an adapter concern.
|
robneville73
commented
Oct 31, 2017
I can fork your rfc and try to do that if you'd like though I'm a little fuzzy on what you mean by entangling in snaphot via adapter. |
hjdivad
commented
Oct 31, 2017
Basically think through how to change the example when you don't have I imagine the way this would work is that the parent object will be Something like // models/order.jsDS.Model.extend({items: DS.hasMany('items'),});// routes/order.jsEmber.Route.extend({actions: {saveOrder(order){order.save();}}});// adapters/order.jsDS.Adapter.extend({createRecord(store,modelClass,snapshot){snapshot.belongsTo('items').forEach(itemSnapshot=>{// this would transition `itemSnaphot.record` and entangle `itemSnapshot` with //`snapshot` such that when the order's record transitions away from in flight, // so does the item's recorditemSnapshot.savedWith(snapshot);});}});Does that make sense? |
hjdivad
commented
Jun 19, 2019
Closing. Of the three items this RFC is concerned with, two are handled by the merged identifiers rfc. The remaining item is an API for co-mingling record lifecycles for multiple records with one promise (whether nested saves, or optimistic changes based on knowing the semantics of a particular API) which we'd prefer to do as a separate rfc. |
Rendered