You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: