Ember JS and polymorphic data

Hi,

I’m fairly new to Ember JS and I’m trying to design a feed that can display different type of data for example videos report objects, (image-text) report objects. I made a model each for both objects but because I want to handle them similarly in a route and make a request for them at the same time I made these models extend from a single mother model called feedable. I created another model called feed-item that has a polymorphic belongs to relationship with one feedable so I can design an endpoint for feed-items that would return all feedables…

So so far my models:

models/feed-item.js import DS from ‘ember-data’;

export default DS.Model.extend({
  feedable: DS.belongsTo('feedable', {polymorphic: true})
})

models/feedable.js import DS from ‘ember-data’;

export default DS.Model.extend({
})

models/video-report.js import DS from ‘ember-data’; import Feedable from ‘./feedable’

export default Feedable.extend({
  content:       DS.attr('string'),
})

models/report.js import DS from ‘ember-data’; import Feedable from ‘./feedable’

export default Feedable.extend({
  status:     DS.attr('number')
})

I’m using the old DS.RESTSERIALIZER and the response from store.findAll(‘feed-item’) is:

{
   feed_items: [
     {  id: 1, 
         feedable: {
               type: "video_report",
               id: 1 
         }
     },
     {  id: 2, 
         feedable: {
               type: "report",
               id: 2, 
         }
     }],
   reports: {
         id: 2,
         status: 0
   },
   video_reports: {
        id: 1,
        content: "cupped-kittens",
   },
}

However the data push to the store has not initialized the relationship between the feedable and feed item i.e. it doesn’t seem to link the objects under video reports and report in the JSON response to the appropriate feedable. Is there’s something special I need to do in serializer or adapter?

I have looked at many tutorials and have not been able to find out what I’m mission or what I’m doing wrong. Any help will be appreciated. Thanks.