Sideload data based on related types, not the names of foreign keys
Clean up test that used to require that a belongsTo relationship be set after `createRecord`
CURRENT_API_REVISION: 12
Merge pull request #776 from dgeb/sideloaded-keys

REV 12: Update serialization conventions
Fix: pass `this` into `normalizeSideloadMappings()`
Clean up FK ids in test
Merge pull request #777 from dgeb/fix-normalize-sideload-mappings

Fix normalizeSideloadMappings() in the JSON adapter
Added support for polymorphic associations.

App.User = DS.Model.extend({
 messages: DS.hasMany(App.Message, {polymorphic: true})
});

App.Message = DS.Model.extend({
  created_at: DS.attr('date'),
  user: DS.belongsTo(App.User)
});

App.Post = App.Message.extend({
  title: DS.attr('string')
});

App.Comment = App.Message.extend({
  body: DS.attr('string'),
  message: DS.belongsTo(App.Message, {polymorphic: true})
});

You need to configure the serializer to map to the correct type:

DS.RESTAdapter.configure('App.Post' {
  alias: 'post'
});
DS.RESTAdapter.configure('App.Comment' {
  alias: 'comment'
});

Initializing an alias will automatically allow you to sideload this
type. The support for sideloadAs is only for backward compatibility.

Two hooks exist for the serialization and materialization of an embedded
polymorphic association:
* `addType` that adds the record's type to the serialized data
* `extractEmbeddedType` that retrieves the record's type from the
payload.

Both hooks rely in the JSONSerializer on `keyForEmbeddedType`, which returns the string used to
represent the record's type in the payload. The default value is
`'type'`