Has anyone used ember-data to model a tree of data?
I would assume it would be something like:
Node = DS.Model.extend({ children: DS.hasMany(Node),
Not sure but as per example given in ember guide
App.Post = DS.Model.extend({ comments: DS.hasMany('App.Comment') });
The JSON should encode the relationship as an array of IDs:
{ "post": { "comment_ids": [1, 2, 3] } }