Skip to content

Commit 06f6a7b

Browse files
committed
fix ember-data links
1 parent 9632ba6 commit 06f6a7b

File tree

12 files changed

+45
-45
lines changed

12 files changed

+45
-45
lines changed

guides/v6.4.0/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ At the top of the page (for the package, method, or class), you will find the wo
3131

3232
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.
3333

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."
3535

3636
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).
3737

guides/v6.4.0/in-depth-topics/native-classes-in-depth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ after overriding. This allows the super class method to continue operating as it
720720
normally would.
721721

722722
One common example is when overriding the
723-
[`normalizeResponse()`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer/methods/normalizeResponse?anchor=normalizeResponse)
723+
[`normalizeResponse()`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer/methods/normalizeResponse?anchor=normalizeResponse)
724724
hook in one of EmberData's serializers.
725725

726726
A handy shortcut for this is to use a "spread operator", like `...arguments`:

guides/v6.4.0/models/creating-updating-and-deleting-records.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Creating Records
22

33
You can create records by calling the
4-
[`createRecord()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/createRecord?anchor=createRecord)
4+
[`createRecord()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/createRecord?anchor=createRecord)
55
method on the store.
66

77
```javascript
@@ -28,7 +28,7 @@ this.store.findRecord('post', 1).then(function(post) {
2828
## Persisting Records
2929

3030
Records in EmberData are persisted on a per-instance basis.
31-
Call [`save()`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/methods/save?anchor=save)
31+
Call [`save()`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/methods/save?anchor=save)
3232
on any instance of `Model` and it will make a network request.
3333

3434
EmberData takes care of tracking the state of each record for
@@ -60,10 +60,10 @@ store.findRecord('post', 1).then(function(post) {
6060

6161
You can tell if a record has outstanding changes that have not yet been
6262
saved by checking its
63-
[`hasDirtyAttributes`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)
63+
[`hasDirtyAttributes`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)
6464
property. You can also see which parts of
6565
the record were changed and what the original value was using the
66-
[`changedAttributes()`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/methods/changedAttributes?anchor=changedAttributes)
66+
[`changedAttributes()`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/methods/changedAttributes?anchor=changedAttributes)
6767
method. `changedAttributes` returns an object, whose keys are the changed
6868
properties and values are an array of values `[oldValue, newValue]`.
6969

@@ -75,7 +75,7 @@ person.hasDirtyAttributes; // => true
7575
person.changedAttributes(); // => { isAdmin: [false, true] }
7676
```
7777

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.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).
7979

8080
```javascript
8181
person.hasDirtyAttributes; // => true
@@ -105,7 +105,7 @@ the errors from saving a blog post in your template:
105105

106106
## Promises
107107

108-
[`save()`](https://api.emberjs.com/ember-data/5.5.0/classes/Model/methods/save?anchor=save) returns
108+
[`save()`](https://api.emberjs.com/ember-data/5.4.1/classes/Model/methods/save?anchor=save) returns
109109
a promise, which makes it easy to asynchronously handle success and failure
110110
scenarios. Here's a common pattern:
111111

@@ -126,10 +126,10 @@ try {
126126

127127
## Deleting Records
128128

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)
130130
on any instance of `Model`. This flags the record as `isDeleted`. The
131131
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.
133133

134134
```javascript
135135
let post = store.peekRecord('post', 1);

guides/v6.4.0/models/customizing-adapters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ export default class PostAdapter extends JSONAPIAdapter {
5151
EmberData comes with several built-in adapters.
5252
Feel free to use these adapters as a starting point for creating your own custom adapter.
5353

54-
- [`Adapter`](https://api.emberjs.com/ember-data/5.5.0/classes/Adapter) is the basic adapter
54+
- [`Adapter`](https://api.emberjs.com/ember-data/5.4.1/classes/Adapter) is the basic adapter
5555
with no functionality. It is generally a good starting point if you
5656
want to create an adapter that is radically different from the other
5757
Ember adapters.
5858

59-
- [`JSONAPIAdapter`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPIAdapter)
59+
- [`JSONAPIAdapter`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPIAdapter)
6060
The `JSONAPIAdapter` is the default adapter and follows JSON:API
6161
conventions to communicate with an HTTP server by transmitting JSON
6262
via XHR.
6363

64-
- [`RESTAdapter`](https://api.emberjs.com/ember-data/5.5.0/classes/RESTAdapter)
64+
- [`RESTAdapter`](https://api.emberjs.com/ember-data/5.4.1/classes/RESTAdapter)
6565
The `RESTAdapter` allows your store to communicate with an HTTP server
6666
by transmitting JSON via XHR. Before EmberData 2.0 this adapter was the default.
6767

6868

6969
## Customizing the JSONAPIAdapter
7070

7171
The
72-
[JSONAPIAdapter](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPIAdapter)
72+
[JSONAPIAdapter](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPIAdapter)
7373
has a handful of hooks that are commonly used to extend it to work
7474
with non-standard backends.
7575

guides/v6.4.0/models/customizing-serializers.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ format, EmberData allows you to customize the serializer or use a
55
different serializer entirely.
66

77
EmberData ships with 3 serializers. The
8-
[`JSONAPISerializer`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer)
8+
[`JSONAPISerializer`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer)
99
is the default serializer and works with JSON:API backends. The
10-
[`JSONSerializer`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONSerializer)
10+
[`JSONSerializer`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONSerializer)
1111
is a simple serializer for working with single JSON object or arrays of records. The
12-
[`RESTSerializer`](https://api.emberjs.com/ember-data/5.5.0/classes/RESTSerializer)
12+
[`RESTSerializer`](https://api.emberjs.com/ember-data/5.4.1/classes/RESTSerializer)
1313
is a more complex serializer that supports sideloading and was the default
1414
serializer before 2.0.
1515

@@ -141,7 +141,7 @@ export default class PostSerializer extends JSONAPISerializer {
141141
```
142142

143143
To change the format of the data that is sent to the backend store, you can use
144-
the [`serialize()`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer/methods/serialize?anchor=serialize)
144+
the [`serialize()`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer/methods/serialize?anchor=serialize)
145145
hook. Let's say that we have this JSON:API response from EmberData:
146146

147147
```json
@@ -200,7 +200,7 @@ export default class ApplicationSerializer extends JSONAPISerializer {
200200

201201
Similarly, if your backend store provides data in a format other than JSON:API,
202202
you can use the
203-
[`normalizeResponse()`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer/methods/normalizeResponse?anchor=normalizeResponse)
203+
[`normalizeResponse()`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer/methods/normalizeResponse?anchor=normalizeResponse)
204204
hook. Using the same example as above, if the server provides data that looks
205205
like:
206206

@@ -254,11 +254,11 @@ export default class ApplicationSerializer extends JSONAPISerializer {
254254
```
255255

256256
To normalize only a single model, you can use the
257-
[`normalize()`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer/methods/normalize?anchor=normalize)
257+
[`normalize()`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer/methods/normalize?anchor=normalize)
258258
hook similarly.
259259

260260
For more hooks to customize the serializer with, see the [EmberData serializer
261-
API documentation](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer).
261+
API documentation](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer).
262262

263263
### IDs
264264

@@ -311,7 +311,7 @@ in the document payload returned by your server:
311311

312312
If the attributes returned by your server use a different convention
313313
you can use the serializer's
314-
[`keyForAttribute()`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer/methods/keyForAttribute?anchor=keyForAttribute)
314+
[`keyForAttribute()`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer/methods/keyForAttribute?anchor=keyForAttribute)
315315
method to convert an attribute name in your model to a key in your JSON
316316
payload. For example, if your backend returned attributes that are
317317
`under_scored` instead of `dash-cased` you could override the `keyForAttribute`
@@ -422,7 +422,7 @@ The JSON should encode the relationship as an ID to another record:
422422
```
423423
If needed these naming conventions can be overwritten by implementing
424424
the
425-
[`keyForRelationship()`](https://api.emberjs.com/ember-data/5.5.0/classes/JSONAPISerializer/methods/keyForRelationship?anchor=keyForRelationship)
425+
[`keyForRelationship()`](https://api.emberjs.com/ember-data/5.4.1/classes/JSONAPISerializer/methods/keyForRelationship?anchor=keyForRelationship)
426426
method.
427427

428428
```javascript {data-filename=app/serializers/application.js}
@@ -545,7 +545,7 @@ looks similar to this:
545545
The `JSONAPISerializer` is built on top of the `JSONSerializer` so they share
546546
many of the same hooks for customizing the behavior of the
547547
serialization process. Be sure to check out the
548-
[API docs](https://api.emberjs.com/ember-data/5.5.0/classes/JSONSerializer)
548+
[API docs](https://api.emberjs.com/ember-data/5.4.1/classes/JSONSerializer)
549549
for a full list of methods and properties.
550550

551551

@@ -751,7 +751,7 @@ Note that the type is `"post"` to match the post model and the
751751
### Normalizing adapter responses
752752

753753
When creating a custom serializer you will need to define a
754-
[normalizeResponse](https://api.emberjs.com/ember-data/5.5.0/classes/Serializer/methods/normalizeResponse?anchor=normalizeResponse)
754+
[normalizeResponse](https://api.emberjs.com/ember-data/5.4.1/classes/Serializer/methods/normalizeResponse?anchor=normalizeResponse)
755755
method to transform the response from the adapter into the normalized
756756
JSON object described above.
757757

@@ -763,7 +763,7 @@ the possible values of: `'findRecord'`, `'queryRecord'`, `'findAll'`,
763763
`'createRecord'`, `'deleteRecord'`, and `'updateRecord'`) as arguments.
764764

765765
A custom serializer will also need to define a
766-
[normalize](https://api.emberjs.com/ember-data/5.5.0/classes/Serializer/methods/normalize?anchor=normalize)
766+
[normalize](https://api.emberjs.com/ember-data/5.4.1/classes/Serializer/methods/normalize?anchor=normalize)
767767
method.
768768
This method is called by `store.normalize(type, payload)` and is often
769769
used for normalizing requests made outside of EmberData because they
@@ -772,7 +772,7 @@ do not fall into the normal CRUD flow that the adapter provides.
772772
### Serializing records
773773

774774
Finally a serializer will need to implement a
775-
[serialize](https://api.emberjs.com/ember-data/5.5.0/classes/Serializer/methods/serialize?anchor=serialize)
775+
[serialize](https://api.emberjs.com/ember-data/5.4.1/classes/Serializer/methods/serialize?anchor=serialize)
776776
method.
777777
EmberData will provide a record snapshot and an options hash and this
778778
method should return an object that the adapter will send to the

guides/v6.4.0/models/defining-models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ and [working with records](../creating-updating-and-deleting-records/) of that t
3939
## Defining Attributes
4040

4141
The `person` model we generated earlier didn't have any attributes. Let's
42-
add first and last name, as well as the birthday, using [`attr`](https://api.emberjs.com/ember-data/5.5.0/functions/@ember-data%2Fmodel/attr):
42+
add first and last name, as well as the birthday, using [`attr`](https://api.emberjs.com/ember-data/5.4.1/functions/@ember-data%2Fmodel/attr):
4343

4444
```javascript {data-filename=app/models/person.js}
4545
import Model, { attr } from '@ember-data/model';

guides/v6.4.0/models/finding-records.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The EmberData store provides an interface for retrieving records of a single typ
22

33
### Retrieving a Single Record
44

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.
66
This will return a promise that fulfills with the requested record:
77

88
```javascript
@@ -13,7 +13,7 @@ this.store.findRecord('blog-post', 1) // => GET /blog-posts/1
1313
});
1414
```
1515

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.
1717
This will return the record only if it is already present in the store:
1818

1919
```javascript
@@ -22,7 +22,7 @@ let blogPost = this.store.peekRecord('blog-post', 1); // => no network request
2222

2323
### Retrieving Multiple Records
2424

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:
2626

2727
```javascript
2828
// GET /blog-posts
@@ -32,7 +32,7 @@ this.store.findAll('blog-post') // => GET /blog-posts
3232
});
3333
```
3434

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:
3636

3737
```javascript
3838
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.
4747
### Querying for Multiple Records
4848

4949
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.
5151
This method returns a `PromiseArray` in the same way as `findAll`.
5252

5353
For example, we could search for all `person` models who have the name of
@@ -67,7 +67,7 @@ this.store.query('person', {
6767
### Querying for A Single Record
6868

6969
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.
7171
The request is made via a method `queryRecord()` defined by the adapter.
7272

7373
For example, if your server API provides an endpoint for the currently logged in user:
@@ -95,7 +95,7 @@ export default class UserAdapter extends Adapter {
9595
}
9696
```
9797

98-
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:
9999

100100
```javascript
101101
store.queryRecord('user', {}).then(function(user) {
@@ -108,7 +108,7 @@ As in the case of `store.query()`, a query object can also be passed to `store.q
108108
However the adapter must return a single model object, not an array containing one element,
109109
otherwise EmberData will throw an exception.
110110

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.
112112

113113
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:
114114

guides/v6.4.0/models/pushing-records-into-the-store.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ you want to update the UI immediately.
1919

2020
### Pushing Records
2121

22-
To push a record into the store, call the store's [`push()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/push?anchor=push) method.
22+
To push a record into the store, call the store's [`push()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/push?anchor=push) method.
2323

2424
For example, imagine we want to preload some data into the store when
2525
the application boots for the first time.
@@ -81,7 +81,7 @@ the casing of the properties defined on the Model class.
8181

8282
If you would like the data to be normalized by the model's default
8383
serializer before pushing it into the store, you can use the
84-
[`store.pushPayload()`](https://api.emberjs.com/ember-data/5.5.0/classes/Store/methods/pushPayload?anchor=pushPayload) method.
84+
[`store.pushPayload()`](https://api.emberjs.com/ember-data/5.4.1/classes/Store/methods/pushPayload?anchor=pushPayload) method.
8585

8686
```javascript {data-filename=app/serializers/album.js}
8787
import RESTSerializer from '@ember-data/serializer/rest';

guides/v6.4.0/models/relationships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ include those related records in the response returned to the client.
361361
The value of the parameter should be a comma-separated list of names of the
362362
relationships required.
363363

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),
365365
you can easily add the `include` parameter to the server requests created by
366366
the `findRecord()`, `findAll()`,
367367
`query()` and `queryRecord()` methods.

0 commit comments

Comments
 (0)