How to create a 1:m relationship on EmberJS?


I have a table with 1:m relationship. Assume we have tables Comment, Post and Image. A comment can be associated to either an image or a post via commentable_id and commentable - we say that Post and Image are Commentable. How do we construct it in EmberJS?

Please refer to the above link for the relationship details.


This is called a polymorphic relation. Google for it and you will find some decent presentation on this subject.