Skip to content

Instantly share code, notes, and snippets.

@sly7-7
Created September 22, 2014 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sly7-7/a75f2bfd72c801d5414f to your computer and use it in GitHub Desktop.
Save sly7-7/a75f2bfd72c801d5414f to your computer and use it in GitHub Desktop.
relationships weirdness
App.Event = DS.Model.extend({
user: DS.belongsTo('user'),
project: DS.belongsTo('project', {inverse: null})
});
App.Project = DS.Model.extend({
users: DS.hasMany('user', { async: true, inverse: null}),
administrators: DS.hasMany('user', { async: true, inverse: null}),
});
App.User = DS.Model.extend({
// crash if not defined
//events: DS.hasMany('event', {async: true})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment