Skip to content

Instantly share code, notes, and snippets.

@knownasilya
Last active August 29, 2015 14:08
Show Gist options
  • Save knownasilya/1dd9a7d641cbf8fbf141 to your computer and use it in GitHub Desktop.
Save knownasilya/1dd9a7d641cbf8fbf141 to your computer and use it in GitHub Desktop.
polymorphic
{
"user": {
"id": 44,
"profileType": "providerProfile",
"profile": 1
},
"profile": {
"id": 1,
"type": "providerProfile"
}
}
this.store.push('profile', data.profile);
this.store.push('user', data.user);
// error can only use 'profile' model..
App.User = DS.Model.extend({
profile: DS.belongsTo('profile', { polymorphic: true })
});
App.Profile = DS.Model.extend({
// attrs here
});
App.ProviderProfile = App.Profile.extend({
// attrs here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment