collection.model is replaced #472

moldcraft opened this Issue Jun 10, 2014 · 3 comments


None yet

4 participants


Our application uses clever Backbone.Collection.model() because we store in collection different types of models. We have "dynamic" relatedModel.

I made a (mini copy) demo of our application to demonstrate how it works and where is the problem.

Here it is

Here it uses my fixed version of Backbone-relational

The idea is that Backbone-relational should not replace Collection.model if it's something custom wrote by user. This means that user knows that it should return and instance of relatedModel but he wants to do there some clever logic. Backbone-relational should allow him to have a custom Collection.model.

lunks commented Jul 7, 2014

While my use case could be solved by having a custom relatedModel call in the association, this works as well and looks cleaner.


We are using the fixed version in this project


Sound useful for some cases. Could you maybe make a pull request out of this, and add a small test to demonstrate how to use this feature?

@bpatram bpatram added the enhancement label Mar 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment