Closed hperl closed 2 years ago
I'm going to mark this as an enhancement. The issue is that lazy models do not make their associations available until they are loaded. One possible fix would be to make lazy models return lazy models for their associations as well.
This would be really great, especially if the lazy associations were to fill themselves with content later. It would be very useful to me because most of my routes use relationships as their models (to get auto-updating).
It works well when navigating from to root route to sub routes, but is does not when getting directly to a sub route with an url. (because the relationships along the way are not available, I think).
I also had problems when trying to observe properties of one model from another through relationships: EPF complained that something should be attached to a session. I suppose it comes from LazyModels, because I saw that a lot in the debugger :) but I can't be sure.
is there a workaround for this issue?
FYI, this can also happen if you forget to pass the model to the link-to
:)
The
linkTo
helper breaks when I want to link to a model in a HABTM relationship with an explicit join model. It looks like since the join model is lazy loaded, the property for which thelinkTo
helper needs to create the route does not even exist.Consider the following example:
articles/show.hbs
I get the following errors:
It seems like that since in the article's view, the authorship is still a lazy model, a lookup of the
person
property of the lazy model fails and the route generation fails as well.Any ideas?
This is possibly related to issue #34.