1
votes

Copy-pasting both the "payload" and the serializer from the API-documentation I have created the folowing JsFiddle:

http://jsfiddle.net/NQKvy/481/

I get the following error:

Error while loading route: Error: Assertion Failed: You must include an id in a hash passed to push

Any ideas?

1

1 Answers

0
votes

http://jsfiddle.net/UEaQ4/

Ember doesn't use normalizeHash. I don't why. I changed payload before pass it to _super

payload = { 
  comments: comments.map(function(hash){
    hash.id = hash._id;
    hash.title = hash.comment_title;
    delete hash._id;
    delete hash.comment_title;
    return hash;
  }),
  posts: posts };

and also store comment._id in post instead of comment itself

postCache[comment.post_id].comments.push(comment._id);

and it works.