I have 3 emberData models:
App.Product = DS.Model.extend({ page_title: DS.attr('string'), shop: DS.belongsTo('App.Shop'), user: DS.belongsTo('App.User') }); App.Shop = DS.Model.extend({ name: DS.attr('string'), }); App.User = DS.Model.extend({ name: DS.attr('string') });
and the JSON data is as follows:
{ products: [ { id: "1", page_title: "Product 1", user_id: "1", shop_id: "1", }, { id: "2", page_title: "Product 2", user_id: "2", shop_id: "1", } ], users: [ { id: "1", name: "User 1" }, { id: "2", name: "User 2" } ], shops: [ { id: "1", name: "Shop 1" } ] }
But when I load the data, I got the following error:
Assertion failed: Your server returned a hash with the key shops but you have no mapping for it
source share