Closed nachocodoner closed 8 years ago
This looks like really great stuff. There's merge conflicts looks like with another pull of yours actually. Can you take a look while we finish our review? Thanks very much!
Thanks, I have checked it and yes, a merge option was not needed when "many-to-*" associations are being built. It is now just done as formerly. The conflict is solved.
Oops, looks like not again ;)
Conflicts are resolved. :P
Hi everyone!
Supermodel is an amazing Backbone plugin for model tracking. It creates a lightweight solution. However, there are some features I miss by this kind of library. Because of that, I have been working on them and I will bring them up to you little by little.
Basically, I have had the necessity to enable Supermodel to support local realtionships, serialization options and inheritance features. I bring you local relationships at this time.
Local relationships
Supermodel provides a way to make relationships between models. Yet, it is not able to set them up unless you have a remote identification (idAtributte). It steps away from the idea of building offline web applications. For this reason, I have enabled "Supermodel" the possibility to make relationships between local models (identified by cid) and when a remote identification is available, it will change references automatically. It will work for all kind of relationships supported by "Supermodel" (one-to-one, many-to-one and many-to-many).
Considerations
Examples
One-to-one example
Many-to-one example
I hope you enjoy it! I will bring the rest during the next week.
PD: This branch includes some corrections and test fixing I made for newer versions of Backbone.js. I made a pull request formerly. (https://github.com/pathable/supermodel/pull/65)