@ember-data/model 4.1.0 → 4.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/-private/model.js +2 -44
- package/package.json +5 -5
package/addon/-private/model.js
CHANGED
|
@@ -16,7 +16,6 @@ import { CUSTOM_MODEL_CLASS, RECORD_DATA_ERRORS, REQUEST_SERVICE } from '@ember-
|
|
|
16
16
|
import { HAS_DEBUG_PACKAGE } from '@ember-data/private-build-infra';
|
|
17
17
|
import {
|
|
18
18
|
DEPRECATE_EVENTED_API_USAGE,
|
|
19
|
-
DEPRECATE_MODEL_TOJSON,
|
|
20
19
|
DEPRECATE_RECORD_LIFECYCLE_EVENT_METHODS,
|
|
21
20
|
} from '@ember-data/private-build-infra/deprecations';
|
|
22
21
|
import {
|
|
@@ -78,7 +77,7 @@ function findPossibleInverses(type, inverseType, name, relationshipsSoFar) {
|
|
|
78
77
|
|
|
79
78
|
/*
|
|
80
79
|
* This decorator allows us to lazily compute
|
|
81
|
-
* an expensive getter on first-access and
|
|
80
|
+
* an expensive getter on first-access and thereafter
|
|
82
81
|
* never recompute it.
|
|
83
82
|
*/
|
|
84
83
|
function computeOnce(target, key, desc) {
|
|
@@ -1870,7 +1869,7 @@ class Model extends EmberObject {
|
|
|
1870
1869
|
|
|
1871
1870
|
```javascript
|
|
1872
1871
|
import { get } from '@ember/object';
|
|
1873
|
-
import
|
|
1872
|
+
import Person from 'app/models/person'
|
|
1874
1873
|
|
|
1875
1874
|
let attributes = Person.attributes
|
|
1876
1875
|
|
|
@@ -2177,47 +2176,6 @@ if (DEPRECATE_EVENTED_API_USAGE) {
|
|
|
2177
2176
|
});
|
|
2178
2177
|
}
|
|
2179
2178
|
|
|
2180
|
-
if (DEPRECATE_MODEL_TOJSON) {
|
|
2181
|
-
/**
|
|
2182
|
-
Use [JSONSerializer](JSONSerializer.html) to
|
|
2183
|
-
get the JSON representation of a record.
|
|
2184
|
-
|
|
2185
|
-
`toJSON` takes an optional hash as a parameter, currently
|
|
2186
|
-
supported options are:
|
|
2187
|
-
|
|
2188
|
-
- `includeId`: `true` if the record's ID should be included in the
|
|
2189
|
-
JSON representation.
|
|
2190
|
-
|
|
2191
|
-
@method toJSON
|
|
2192
|
-
@public
|
|
2193
|
-
@param {Object} options
|
|
2194
|
-
@return {Object} A JSON representation of the object.
|
|
2195
|
-
*/
|
|
2196
|
-
Model.reopen({
|
|
2197
|
-
toJSON(options) {
|
|
2198
|
-
// container is for lazy transform lookups
|
|
2199
|
-
deprecate(
|
|
2200
|
-
`Called the built-in \`toJSON\` on the record "${this.constructor.modelName}:${this.id}". The built-in \`toJSON\` method on instances of classes extending \`Model\` is deprecated. For more information see the link below.`,
|
|
2201
|
-
false,
|
|
2202
|
-
{
|
|
2203
|
-
id: 'ember-data:model.toJSON',
|
|
2204
|
-
until: '4.0',
|
|
2205
|
-
url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_record-toJSON',
|
|
2206
|
-
for: '@ember-data/model',
|
|
2207
|
-
since: {
|
|
2208
|
-
available: '3.15',
|
|
2209
|
-
enabled: '3.15',
|
|
2210
|
-
},
|
|
2211
|
-
}
|
|
2212
|
-
);
|
|
2213
|
-
let serializer = this._internalModel.store.serializerFor('-default');
|
|
2214
|
-
let snapshot = this._internalModel.createSnapshot();
|
|
2215
|
-
|
|
2216
|
-
return serializer.serialize(snapshot, options);
|
|
2217
|
-
},
|
|
2218
|
-
});
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
2179
|
if (DEBUG) {
|
|
2222
2180
|
let lookupDescriptor = function lookupDescriptor(obj, keyName) {
|
|
2223
2181
|
let current = obj;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/model",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0-beta.0",
|
|
4
4
|
"description": "The default blueprint for ember-cli addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"test:node": "mocha"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@ember-data/canary-features": "4.
|
|
22
|
-
"@ember-data/private-build-infra": "4.
|
|
23
|
-
"@ember-data/store": "4.
|
|
21
|
+
"@ember-data/canary-features": "4.2.0-beta.0",
|
|
22
|
+
"@ember-data/private-build-infra": "4.2.0-beta.0",
|
|
23
|
+
"@ember-data/store": "4.2.0-beta.0",
|
|
24
24
|
"@ember/edition-utils": "^1.2.0",
|
|
25
25
|
"@ember/string": "^3.0.0",
|
|
26
26
|
"ember-auto-import": "^2.2.4",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"inflection": "~1.13.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@ember-data/unpublished-test-infra": "4.
|
|
36
|
+
"@ember-data/unpublished-test-infra": "4.2.0-beta.0",
|
|
37
37
|
"@ember/optional-features": "^2.0.0",
|
|
38
38
|
"@ember/test-helpers": "^2.6.0",
|
|
39
39
|
"broccoli-asset-rev": "^3.0.0",
|