Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

collection.model is replaced #472

Open
moldcraft opened this Issue · 3 comments

3 participants

@moldcraft

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

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

@moldcraft

We are using the fixed version in this project

@PaulUithol
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.