Nested routes don't appear to update model

Hey @GrandSlam90,

What store method are you using in the model hook of the colleagues/colleague/:id/vacation route? Because that is a parent route I wouldn’t expect it to refresh it’s model (though I think there may be ways you can force it to). If a transition occurs “within” a parent route, like in your case, the parent route model will not refresh AFAIK. My hunch is that if you went to a completely different route and then went back to the c/c/id/vacation route it would do a refetch.

Anyway, the reason for my first question is that your model should still update IF you used peekAll or findAll. I’m assuming you’re doing sometihing like createRecord followed by a save, which should live update any record arrays that result from findAll/peekAll. Unfortunately AFAIK store.query does NOT return a live record array, so if you’re using store.query in the vacation route model, you will not get additional records in the array even though they are already present in your front end store. It’s a real pain.

If you are using query the general recommendation seems to be “use a query to load everything into the store, but then use peekAll in the actual model hook and then filter it down to what you need in the controller”. Not a great solution IMHO but it’s what we’ve got.

For further reading:

(^ this one was opened by me and got hijacked into a different topic so no real answers)