@@ -1257,7 +1257,7 @@ export class Store extends BaseClass {
1257
1257
```app/routes/post.js
1258
1258
export default class PostRoute extends Route {
1259
1259
model(params) {
1260
- return this.store.findRecord('post', params.post_id, { include: 'comments' });
1260
+ return this.store.findRecord('post', params.post_id, { include: [ 'comments'] });
1261
1261
}
1262
1262
}
1263
1263
```
@@ -1284,15 +1284,17 @@ export class Store extends BaseClass {
1284
1284
In this case, the post's comments would then be available in your template as
1285
1285
`model.comments`.
1286
1286
1287
- Multiple relationships can be requested using an `include` parameter consisting of a
1288
- comma-separated list (without white-space) while nested relationships can be specified
1289
- using a dot-separated sequence of relationship names. So to request both the post's
1287
+ Multiple relationships can be requested using an `include` parameter consisting
1288
+ of a list of relationship names, while nested relationships can be specified using a
1289
+ dot-separated sequence of relationship names. So to request both the post's
1290
1290
comments and the authors of those comments the request would look like this:
1291
1291
1292
1292
```app/routes/post.js
1293
1293
export default class PostRoute extends Route {
1294
1294
model(params) {
1295
- return this.store.findRecord('post', params.post_id, { include: 'comments,comments.author' });
1295
+ return this.store.findRecord('post', params.post_id, {
1296
+ include: ['comments', 'comments.author']
1297
+ });
1296
1298
}
1297
1299
}
1298
1300
```
@@ -1909,19 +1911,19 @@ export class Store extends BaseClass {
1909
1911
```app/routes/posts.js
1910
1912
export default class PostsRoute extends Route {
1911
1913
model() {
1912
- return this.store.findAll('post', { include: 'comments' });
1914
+ return this.store.findAll('post', { include: [ 'comments'] });
1913
1915
}
1914
1916
}
1915
1917
```
1916
1918
Multiple relationships can be requested using an `include` parameter consisting of a
1917
- comma-separated list (without white-space) while nested relationships can be specified
1919
+ list of relationship names, while nested relationships can be specified
1918
1920
using a dot-separated sequence of relationship names. So to request both the posts'
1919
1921
comments and the authors of those comments the request would look like this:
1920
1922
1921
1923
```app/routes/posts.js
1922
1924
export default class PostsRoute extends Route {
1923
1925
model() {
1924
- return this.store.findAll('post', { include: 'comments, comments.author' });
1926
+ return this.store.findAll('post', { include: [ 'comments', ' comments.author'] });
1925
1927
}
1926
1928
}
1927
1929
```
0 commit comments