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

The owner record is now an argument passed to findMany on the adapter #625

Merged
merged 1 commit into from Jan 15, 2013
Merged

Conversation

toranb
Copy link
Contributor

@toranb toranb commented Jan 12, 2013

While writing an adapter for my django backend I was unable to
build a valid url for my hasMany relationships because the owner
was not easily accessible. Going forward the owner will now be an
argument available for custom adapters like the one I ended up writing.

example of how my REST api would lookup hasMany relationships:

If I have a person with many occupations I would look them up like so

/people/1/occupations/

Notice the id 1 above is actually the owner of the occupations (not a
occupation id from the ids array that is passed into findMany)

Instead of passing each id like the built in RESTAdapter the url above
just expects the owner will know how to find each occupation

@toranb
Copy link
Contributor Author

toranb commented Jan 12, 2013

Here is the original issue #573


var person = store.find(Person, 1);

equal(get(person, 'isLoaded'), true, "isLoaded should be false");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is loaded should be false?

While writing an adapter for my django backend I was unable to
build a valid url for my hasMany relationships because the owner
was not easily accessible. Going forward the owner will now be an
argument available for custom adapters like the one I ended up writing.

example of how my REST api would lookup hasMany relationships:

If I have a person with many occupations I would look them up like so

/people/1/occupations/

Notice the id 1 above is actually the owner of the occupations (not a
occupation id from the ids array that is passed into findMany)

Instead of passing each id like the built in RESTAdapter the url above
just expects the owner will know how to find each occupation
@toranb
Copy link
Contributor Author

toranb commented Jan 13, 2013

I had a few assertions with the incorrect error message -I fixed this and pushed that change back up

wycats added a commit that referenced this pull request Jan 15, 2013
The owner record is now an argument passed to findMany on the adapter
@wycats wycats merged commit d443c98 into emberjs:master Jan 15, 2013
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

Successfully merging this pull request may close these issues.

None yet

3 participants