First, I recommend using the latest version of Ember / EmberData, but you will have to process the built-in records to manually improve extractSingle in a custom serializer (see example below). In addition, you must define the following relationships:
App.Activity = DS.Model.extend({ name: DS.attr('string'), owner: DS.belongsTo('user') }); App.User = DS.Model.extend({ name: DS.attr('string'), activities: DS.hasMany('activity') });
Further, I recommend using ActiveModelAdapter if you use underscores when communicating with the server (i.e., as in EmberData 0.13):
App.ApplicationAdapter = DS.ActiveModelAdapter;
Finally, to use owner for User , override typeForRoot in the user serializer.
For instance:
App.ApplicationSerializer = DS.ActiveModelSerializer.extend({ typeForRoot: function(root) { if (root == 'owner' || root == 'owners') { root = 'user'; } return this._super(root); }, // based on: https://github.com/emberjs/data/blob/master/TRANSITION.md
JSBin example
source share