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

Allow lookup of hasMany relationship by inverse if supplied. #3106

Closed
mmoonport opened this issue May 26, 2015 · 1 comment
Closed

Allow lookup of hasMany relationship by inverse if supplied. #3106

mmoonport opened this issue May 26, 2015 · 1 comment

Comments

@mmoonport
Copy link

I have a hasMany relationship that can potentially have hundreds of records in it. This poses an issue with the way ember data calls the findMany and places all the ids in the query string. I propose there be a way to call the api with the inverse if supplied. That way the call is much smaller and would seem to be much more efficient.

For example.

var Project = DS.Model.extend({
groups: DS.hasMany('group', {'inverse': 'project'});
});

instead of calling my api with HOST/api/groups/?ids[]=1&ids[]=2&ids[]=3&ids[]=4...

it would call the query by the inverse

HOST/api/groups/?project=project_id

Any thoughts on how this could be implemented?

@igorT
Copy link
Member

igorT commented May 26, 2015

It seems like #2162 should work for this case

@igorT igorT closed this as completed May 26, 2015
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