jeudi 9 juillet 2015

Pushing record in store with belongsTo relationship

I want to push a new conversation into the store. I am using :

this.store.push('conversation', received_message.conversation);

In this line, "received_message" is JSON data returned from the server by a pusher event. The problem I get is that a conversation has a customer defined by a belongsTo relationship to my customers model. When I want to push, it tells me that Ember-Data expects a string or a number for 'customer' but found an embedded relationship.

I already have DS.EmbeddedRecordsMixin defined with customer always embedded. What do I do? Right now, customer is returned as a JSON object.

Aucun commentaire:

Enregistrer un commentaire