Unknown / Missing parents(reverse relations) when model part of several collection.
Closed this issue · 1 comments
In Backbone.Many
relation the reverse relation is set on the collection. So for a model inside the collection, to find the parents needs to model.collection.parents
. However, if this model is part of two collections simultaneously this doesn't work, as model.collection
contains only the first collection the model was associated to.
Is there some nice way to avoid this situation, or maybe we can change backbone-associations (I would love to contribute) so that each model knows directly its parents even if he is part of multiple collections.
I agonized about this for a long time. But I left it as it is a limitation in Backbone as well. (model.collection vs model.collections). If you have any ideas to solve it, I would love to hear from you in form of a PR.