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

Already on GitHub? Sign in to your account

Records guide is unclear on how to use the toMany relation properly #102

Open
SpacyRicochet opened this Issue Oct 10, 2011 · 0 comments

Comments

Projects
None yet
1 participant

The Records guide (http://guides.sproutcore.com/records.html) is very clear on how to create the different types of relations, such as one-to-many. However, while trying to unit test such a relation by creating and pushing an object, I found out that the guide is wholly inadequate in explaining how you would use objects stored a toMany relation.

The following gist (https://gist.github.com/1276759) shows the frustration I had. The guide doesn't clearly mention that you have to set an ID first, before any relation with an object can make sense and the object is able to be used again through that relation. Also, a little note that ManyArrays won't work with the bracketed index (ie. testObject.get('toManyObjects')[0]), but only with objectAt() is worth mentioning.

This is something that might be obvious to those more used to databases, but not to those that are new to the concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment