Reputation: 45
So, I'm trying to sideload records in ember-data. My models are something like:
App.Product = DS.Model.extend({
name: DS.attr('string'),
category_ids: DS.hasMany('App.Category')
});
App.Category = DS.Model.extend({
title: DS.attr('string')
});
I'm configuring the sideload feature as follows:
App.store.adapter.serializer.configure(App.Category,
{
sideloadAs: 'categories'
});
Upvotes: 0
Views: 1606
Reputation: 3745
You maybe able to provide the proper mappings for it in the adapter
. I'm not sure though. You should provide a sample of your code to better help you.
App.store = DS.Store.create({
revision: 11,
adapter: DS.RESTAdapter.create( {
mappings: {
categories: 'App.Category'
},
})
});
Upvotes: 1