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

Draft: [EmberData] Update guides to suggest include to be an array #2048

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions guides/release/models/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ with the post as well.
The [JSON:API specification allows](http://jsonapi.org/format/#fetching-includes)
servers to accept a query parameter with the key `include` as a request to
include those related records in the response returned to the client.
The value of the parameter should be a comma-separated list of names of the
The value of the parameter should be an array of names of the
relationships required.

If you are using an adapter that supports JSON:API, such as Ember's default [`JSONAPIAdapter`](https://api.emberjs.com/ember-data/release/classes/JSONAPIAdapter),
Expand All @@ -380,7 +380,7 @@ export default class PostRoute extends Route {
@service store;
model(params) {
return this.store.findRecord('post', params.post_id, {
include: 'comments'
include: ['comments']
});
}
}
Expand All @@ -400,7 +400,7 @@ export default class PostRoute extends Route {
@service store;
model(params) {
return this.store.findRecord('post', params.post_id, {
include: 'comments,comments.author'
include: ['comments', 'comments.author']
});
}
}
Expand All @@ -422,7 +422,7 @@ export default class AdeleRoute extends Route {
return this.store
.query('artist', {
filter: { name: 'Adele' },
include: 'albums'
include: ['albums']
})
.then(function(artists) {
return artists[0];
Expand Down
Loading