Skip to content

Commit

Permalink
Update guides to suggest include to ba an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltazore committed Jul 9, 2024
1 parent e873e45 commit 29503a6
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 29503a6

Please sign in to comment.