emberjs/data — pull request #701 by Cyril-sf (2013-02-06 17:57:23+00:00)
Title: 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'),
post: DS.belongsTo(App.Post)
});

* You can add support for embedded polymorphic associations
by overriding`addHasMany` of the serializer.

* BaseClass.find() isn't supported yet and can be the subject of another PR.