In order to use polymorphic relationships in Ember.js, you need to configure your adapter to recognize an alias for the polymorphic model, as documented here:
DS.RESTAdapter.configure('App.Post', {
alias: 'post'
});
Unfortunately, this approach no longer works with Ember Data 1.0Beta, as you can no longer configure adapters. Instead, you have to extend them. Simply doing this doesn't work, however:
DS.ActiveModelAdapter.extend('App.Post', {
alias: 'post'
});
It throws the error:
Expected hash or Mixin instance, got [object String]
This section of Ember-Data's transition guide goes into detail about the new approach to adapters and serializers. I'm not sure how to translate that advice for something like alias: 'post'
, however. The guide goes into a great deal of detail about how payloads are processed, but I don't know where the alias was suppose to fit into that processing.