You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially because you use model.get('pet.id') that first fires off a request to pets/30, I imagine the findRecord then sees it is already waiting on a response for a pet with id 30 - and so doesnt fire a new request to the url I wanted - pets/30/include=toys
I feel like what I had done was slightly wrong, but I'd have rather seen a warning/error as it was very hard to spot - or should ember data make a second request with the includes, after the original basic request comes back?
Question boils down to - if findRecord is already waiting on a request with NO includes, but then a new request comes in WITH includes - what should it do?
@adam-knights sorry for the late response, your work-around looks good. References are the way to go to access information about relationships without triggering network requests.
I'm inclined to close this in favor of Support self links for relationships (reloading, saving, deleting) tracked in #2905. I would like this to allow for loading/reloading relationships with provided include, somehow.
Highly pseudo: post.belongsTo('author').load({ include: 'company' }). This needs to be discussed in more details though and go through the RFC process.
I spent all morning trying to work out why this line of code, in an after model hook, kept hitting /members/123 rather than members/123?include=orders
I've reproduced similar in a twiddle:
https://ember-twiddle.com/d9a58e2070bbdefeb2e9954767830768?fileTreeShown=false&numColumns=2&openFiles=routes.application.js%2Ctemplates.application.hbs
Essentially because you use
model.get('pet.id')
that first fires off a request to pets/30, I imagine the findRecord then sees it is already waiting on a response for a pet with id 30 - and so doesnt fire a new request to the url I wanted - pets/30/include=toys@HeroicEric any thoughts?
I feel like what I had done was slightly wrong, but I'd have rather seen a warning/error as it was very hard to spot - or should ember data make a second request with the includes, after the original basic request comes back?
Question boils down to - if findRecord is already waiting on a request with NO includes, but then a new request comes in WITH includes - what should it do?
FYI I sorted my code, which was to do
Thanks to the new ds refs behavior
The text was updated successfully, but these errors were encountered: