Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collection.model is replaced #472

Open
ghost opened this issue Jun 10, 2014 · 3 comments
Open

collection.model is replaced #472

ghost opened this issue Jun 10, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 10, 2014

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
Copy link

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.

@ghost
Copy link
Author

ghost commented Oct 22, 2014

We are using the fixed version in this project

@PaulUithol
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants