vendredi 23 janvier 2015

How would I fix this one-to-many polymorphic relationship in ember-data?

There are four models:



  • Idea and Comment, which extend Thought

  • Vote


Both an idea and a comment can have multiple votes. However, each vote can only relate to one idea/comment.


Note: Idea is analogous with Post for this example.


The solution I came up with is in this jsbin: http://ift.tt/1ySLyuM


The above code dies when I try to fetch the vote records. It works fine while getting the ideas. Considering how simple this example is, I'm sure I don't understand polymorphic relationships as well as I think I do. Anyways, any hints as to what I'm missing or doing wrong?





Aucun commentaire:

Enregistrer un commentaire