Skip to content

_injectRelations failing when being called with an array of resources during findAll #188

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

Closed
pietschy opened this issue Sep 24, 2014 · 4 comments

Comments

@pietschy
Copy link

The following is failing when the injected item is an array (i.e. during a call to findAll).

// about line 5443
// the following is failing as injected can be an array.
if (definition.relations) {
    _injectRelations.call(DS, definition, injected);
}

I got it working by moving it to the _inject function where it handles singular items.

// about line 5337
resource.index.put(id, item);
// inserted here.
if (definition.relations) {
   _injectRelations.call(DS, definition, item);
}
_react.call(item, {}, {}, {});
@jmdobry
Copy link
Member

jmdobry commented Sep 24, 2014

Can you create a jsfiddle or plnkr that demonstrates the issue?

@pietschy
Copy link
Author

Here it is: http://plnkr.co/edit/aowzlRHfJ8LY55XLDH10?p=info

If you use the patched version of angular data it should work.

Thanks!

@jmdobry
Copy link
Member

jmdobry commented Sep 25, 2014

@pietschy Tell me if this fix doesn't work for you.

@pietschy
Copy link
Author

Yep, that's working. Thanks!

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