You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/v6.4.0/contributing/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ At the top of the page (for the package, method, or class), you will find the wo
31
31
32
32
You can open the link to find a comment block. Make a pull request to update the comment block. The API Guides may take a few weeks to update while the future release is finalized.
33
33
34
-
Here is an example of updating a method. At the top of the section for [`store.createRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/createRecord?anchor=createRecord), you can find the words "Defined in."
34
+
Here is an example of updating a method. At the top of the section for [`store.createRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/createRecord?anchor=createRecord), you can find the words "Defined in."
35
35
36
36
Next to the words is, once again, the link to the source code [`ds-model-store.ts`](https://github.com/emberjs/data/blob/master/packages/store/addon/-private/system/ds-model-store.ts).
At this point, you can either persist your changes via `save()` or you can roll back your changes using [`rollbackAttributes()`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/methods/rollbackAttributes?anchor=rollbackAttributes).
78
+
At this point, you can either persist your changes via `save()` or you can roll back your changes using [`rollbackAttributes()`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/methods/rollbackAttributes?anchor=rollbackAttributes).
79
79
80
80
```javascript
81
81
person.hasDirtyAttributes; // => true
@@ -105,7 +105,7 @@ the errors from saving a blog post in your template:
a promise, which makes it easy to asynchronously handle success and failure
110
110
scenarios. Here's a common pattern:
111
111
@@ -126,10 +126,10 @@ try {
126
126
127
127
## Deleting Records
128
128
129
-
Deleting records is as straightforward as creating records. Call [`deleteRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/methods/deleteRecord?anchor=deleteRecord)
129
+
Deleting records is as straightforward as creating records. Call [`deleteRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/methods/deleteRecord?anchor=deleteRecord)
130
130
on any instance of `Model`. This flags the record as `isDeleted`. The
131
131
deletion can then be persisted using `save()`. Alternatively, you can use
132
-
the [`destroyRecord`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/methods/destroyRecord?anchor=destroyRecord) method to delete and persist at the same time.
132
+
the [`destroyRecord`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/methods/destroyRecord?anchor=destroyRecord) method to delete and persist at the same time.
Copy file name to clipboardExpand all lines: guides/v6.4.0/models/finding-records.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ The EmberData store provides an interface for retrieving records of a single typ
2
2
3
3
### Retrieving a Single Record
4
4
5
-
Use [`store.findRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/findRecord?anchor=findRecord) to retrieve a record by its type and ID.
5
+
Use [`store.findRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/findRecord?anchor=findRecord) to retrieve a record by its type and ID.
6
6
This will return a promise that fulfills with the requested record:
7
7
8
8
```javascript
@@ -13,7 +13,7 @@ this.store.findRecord('blog-post', 1) // => GET /blog-posts/1
13
13
});
14
14
```
15
15
16
-
Use [`store.peekRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/peekRecord?anchor=peekRecord) to retrieve a record by its type and ID, without making a network request.
16
+
Use [`store.peekRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/peekRecord?anchor=peekRecord) to retrieve a record by its type and ID, without making a network request.
17
17
This will return the record only if it is already present in the store:
18
18
19
19
```javascript
@@ -22,7 +22,7 @@ let blogPost = this.store.peekRecord('blog-post', 1); // => no network request
22
22
23
23
### Retrieving Multiple Records
24
24
25
-
Use [`store.findAll()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/findAll?anchor=findAll) to retrieve all of the records for a given type:
25
+
Use [`store.findAll()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/findAll?anchor=findAll) to retrieve all of the records for a given type:
26
26
27
27
```javascript
28
28
// GET /blog-posts
@@ -32,7 +32,7 @@ this.store.findAll('blog-post') // => GET /blog-posts
32
32
});
33
33
```
34
34
35
-
Use [`store.peekAll()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/peekAll?anchor=peekAll) to retrieve all of the records for a given type that are already loaded into the store, without making a network request:
35
+
Use [`store.peekAll()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/peekAll?anchor=peekAll) to retrieve all of the records for a given type that are already loaded into the store, without making a network request:
36
36
37
37
```javascript
38
38
let blogPosts =this.store.peekAll('blog-post'); // => no network request
@@ -47,7 +47,7 @@ the `[]` notation will not work--you'll have to use `objectAt(index)` instead.
47
47
### Querying for Multiple Records
48
48
49
49
EmberData provides the ability to query for records that meet certain criteria.
50
-
Calling [`store.query()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/query?anchor=query) will make a `GET` request with the passed object serialized as query params.
50
+
Calling [`store.query()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/query?anchor=query) will make a `GET` request with the passed object serialized as query params.
51
51
This method returns a `PromiseArray` in the same way as `findAll`.
52
52
53
53
For example, we could search for all `person` models who have the name of
@@ -67,7 +67,7 @@ this.store.query('person', {
67
67
### Querying for A Single Record
68
68
69
69
If you are using an adapter that supports server requests capable of returning a single model object,
70
-
EmberData provides a convenience method [`store.queryRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/queryRecord?anchor=queryRecord) that will return a promise that resolves with that single record.
70
+
EmberData provides a convenience method [`store.queryRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/queryRecord?anchor=queryRecord) that will return a promise that resolves with that single record.
71
71
The request is made via a method `queryRecord()` defined by the adapter.
72
72
73
73
For example, if your server API provides an endpoint for the currently logged in user:
Then, calling [`store.queryRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/queryRecord?anchor=queryRecord) will retrieve that object from the server:
98
+
Then, calling [`store.queryRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/queryRecord?anchor=queryRecord) will retrieve that object from the server:
@@ -108,7 +108,7 @@ As in the case of `store.query()`, a query object can also be passed to `store.q
108
108
However the adapter must return a single model object, not an array containing one element,
109
109
otherwise EmberData will throw an exception.
110
110
111
-
Note that Ember's default [JSON:API adapter](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPIAdapter) does not provide the functionality needed to support `queryRecord()` directly as it relies on REST request definitions that return result data in the form of an array.
111
+
Note that Ember's default [JSON:API adapter](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPIAdapter) does not provide the functionality needed to support `queryRecord()` directly as it relies on REST request definitions that return result data in the form of an array.
112
112
113
113
If your server API or your adapter only provides array responses but you wish to retrieve just a single record, you can alternatively use the `query()` method as follows:
Copy file name to clipboardExpand all lines: guides/v6.4.0/models/relationships.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,7 +361,7 @@ include those related records in the response returned to the client.
361
361
The value of the parameter should be a comma-separated list of names of the
362
362
relationships required.
363
363
364
-
If you are using an adapter that supports JSON:API, such as Ember's default [`JSONAPIAdapter`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPIAdapter),
364
+
If you are using an adapter that supports JSON:API, such as Ember's default [`JSONAPIAdapter`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPIAdapter),
365
365
you can easily add the `include` parameter to the server requests created by
0 commit comments