The only thing I can get to work is a hasMany. Let's say I have a object model like so
Book hasMany Chapters
- Book = can.Model "Book", {
- ...
- attributes:
- chapters: "Chapter.models"
- }, {}
- Chapter = can.Model "Chapter", {
- ...
- attributes:
- book: "Book.model"
- }, {}
I provide the json for a book with the chapters embedded and it works fine. But I don't have chapterInstance.book. I have tried adding a book_id to the chapter json, but this doesn't help and I really don't like doing that. What am I doing wrong?
Finally, I find the example in the docs quite confusing, as it sets the attributes on a can.Observe instance, in a declaration that I haven't really seen before. Is this a typo or am I missing something?