Skip to content

Instantly share code, notes, and snippets.

@shenst1
Created June 12, 2015 20:59
Show Gist options
  • Save shenst1/57f6c44940945f247f47 to your computer and use it in GitHub Desktop.
Save shenst1/57f6c44940945f247f47 to your computer and use it in GitHub Desktop.
Notifable polymorphic
App.Notifiable = DS.Model.extend({
notifications: DS.hasMany('notification', {async: true})
});
App.User = DS.Model.extend({
userName: DS.attr('string'),
notifications: DS.hasMany('notification', {async: true})
});
App.Notification = DS.Model.extend({
notifiables: DS.hasMany('notifiable', {polymorphic: true, async: true})
});
App.Dataset = DS.Model.extend({
notifications: DS.hasMany('notification', {async: true})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment