I’ve been using ember + ember data from more than 5 months ago and I have a problem when I’m trying to render the id of a record in a simple list, without making a request to my Api for each record
So, my question is: Why this making a request if I only I’m acceding to the user id? this is a bug or is the expected behavior? I’ve been thinking about it a lot and I have not found sense for this, I mean, if I currently have the user id why I need to do these request??
I’ve been struggling with this as well. It’s specially noticeable when you are linking models.
{{#each team in this}}
{{link-to "user" team.user}}
{{/each}}
I believe the PromiseProxy that DS.belongsTo('user') is returning should not delegate the id and use the one coming from the backend instead, so it doesn’t even have the need of getting a model back unless you ask for something other than the id.
Does that make any sense? Is it worth a PR to ember-data?
T.O.T.A.L.L.Y. agree. Specially for links to other resources. I don’t show any detail of the object in the link, so I don’t want to fetch the data until I enter its route!
In fact I think that this should be used everywhere. I think that the object we have in ember-data relations should not fetch data unless we ask for an attribute that has already been set.