Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS.Model eachRelationship descriptors type is a string but should be of type model #3373

Closed
OleRoel opened this issue Jun 17, 2015 · 1 comment

Comments

@OleRoel
Copy link

OleRoel commented Jun 17, 2015

The documentation of eachRelationship states that the type attribute in the descriptor is of type DS.Model. With Ember.Data beta 19 the type changed to be a string.

The JS Bin for this issue can be found here

@fivetanley
Copy link
Member

Unfortunately this is a breaking change. Due to some internal refactors, the eachRelationship method must return strings because it can be called if it isn't looked up through the store. So docs need to be fixed and you'll have to update your code with something like the following:

function relationshipFor(klass, store) {
  var results = [];
  klass.eachRelationship(function(relationship) {
    results.push(store.modelFor(relationship));
  });
  return results;
}

Maybe it's worth adding something to the store that does that? @igorT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants