Skip to content

Commit be09b82

Browse files
authored
Merge pull request #20 from willsoto/documentation-fixes
Minor example fixes in the documentation
2 parents 7d7803d + 6379bf1 commit be09b82

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const Person = Model.extend({
2929

3030
Config.setup();
3131

32-
Person.where({ name: 'Joe' }).page(2).per(10).sort('name').then((people) => {
33-
let names = people.map((p) => { return p.fullName(); });
32+
Person.where({ name: 'Joe' }).page(2).per(10).sort('name').all().then((people) => {
33+
let names = people.data.map((p) => { return p.fullName(); });
3434
console.log(names); // ['Joe Blow', 'Joe DiMaggio', ...]
3535
});
3636
```

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ if (should_include_admins) {
8484
scope = scope.where({ admin: true });
8585
}
8686
scope.all().then((people) => {
87-
people.map((p) => { return p.firstName; }); // => ['Joe', 'Jane', 'Bill']
87+
people.data.map((p) => { return p.firstName; }); // => ['Joe', 'Jane', 'Bill']
8888
});
8989

9090
scope.page(2).all().then((people) => {
91-
people.map((p) => { return p.firstName; }); // => ['Chris', 'Sarah', 'Ben']
91+
people.data.map((p) => { return p.firstName; }); // => ['Chris', 'Sarah', 'Ben']
9292
});
9393
```
9494

@@ -195,8 +195,8 @@ Person.includes(['tags', { pets: ['toys', 'tags'] }]);
195195
The included resources will now be present:
196196

197197
```js
198-
Person.includes('tags').then((person) => {
199-
person.tags.map((t) => { return t.name; }); // #=> ['funny', 'smart']
198+
Person.includes('tags').all().then((person) => {
199+
person.data.tags.map((t) => { return t.name; }); // #=> ['funny', 'smart']
200200
});
201201
```
202202

0 commit comments

Comments
 (0)