Wildhoney
Wildhoney

Reputation: 4969

Ember DataStore doesn't appear to work. What am I doing wrong?

In this JSFIddle I'm trying to get John (which it does), but then I'm trying to fetch all of John's pets (he should have two), but in fact nothing is returned.

I was under the impression that the DS store would look-up the relationship and fetch the pets for me based on pet_ids.

Could somebody please tell me what I'm doing wrong?

Upvotes: 0

Views: 121

Answers (1)

Dan Gebhardt
Dan Gebhardt

Reputation: 3281

By default, the REST adapter expects pet_ids to be passed in as pets. You can see a working version of your fiddle here.

If you want provide custom mappings, you'll need to use Adapter.map as explained in the breaking changes.

Upvotes: 1

Related Questions