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

Related objects should not be set directly on the Model #5

Open
snurra opened this issue Jun 22, 2015 · 1 comment
Open

Related objects should not be set directly on the Model #5

snurra opened this issue Jun 22, 2015 · 1 comment

Comments

@snurra
Copy link
Contributor

snurra commented Jun 22, 2015

Doing it that way is just asking for trouble. Sooner or later someone will set up a relation with a name that clashes with an already existing Backbone.Model property or method. Plus it's ugly.

I suggest storing them in Backbone.RelationalModel._relations.

A consequence is that Backbone.RelationalModel.someRelation will stop working. However, there is already the alternative (or even preferable) way of Backbone.Model.get("someRelation").

@snurra
Copy link
Contributor Author

snurra commented Jun 23, 2015

Let's save this until 1.0 since it will be a breaking change.

@snurra snurra modified the milestones: backbone-kinship-2.0, backbone-kinship-1.0.0 Jun 26, 2015
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

1 participant