@ember-data/model 4.6.2 → 4.6.4
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A, default as EmberArray } from '@ember/array';
|
|
1
2
|
import { assert } from '@ember/debug';
|
|
2
3
|
import { DEBUG } from '@glimmer/env';
|
|
3
4
|
|
|
@@ -619,13 +620,16 @@ function handleCompletedRelationshipRequest(
|
|
|
619
620
|
}
|
|
620
621
|
|
|
621
622
|
function assertRecordsPassedToHasMany(records: RecordInstance[]) {
|
|
622
|
-
assert(
|
|
623
|
+
assert(
|
|
624
|
+
`You must pass an array of records to set a hasMany relationship`,
|
|
625
|
+
Array.isArray(records) || EmberArray.detect(records)
|
|
626
|
+
);
|
|
623
627
|
assert(
|
|
624
628
|
`All elements of a hasMany relationship must be instances of Model, you passed ${records
|
|
625
629
|
.map((r) => `${typeof r}`)
|
|
626
630
|
.join(', ')}`,
|
|
627
631
|
(function () {
|
|
628
|
-
return records.every((record) => Object.prototype.hasOwnProperty.call(record, '_internalModel') === true);
|
|
632
|
+
return A(records).every((record) => Object.prototype.hasOwnProperty.call(record, '_internalModel') === true);
|
|
629
633
|
})()
|
|
630
634
|
);
|
|
631
635
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-data/model",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.4",
|
|
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.6.
|
|
22
|
-
"@ember-data/private-build-infra": "4.6.
|
|
23
|
-
"@ember-data/store": "4.6.
|
|
21
|
+
"@ember-data/canary-features": "4.6.4",
|
|
22
|
+
"@ember-data/private-build-infra": "4.6.4",
|
|
23
|
+
"@ember-data/store": "4.6.4",
|
|
24
24
|
"@ember/edition-utils": "^1.2.0",
|
|
25
25
|
"@ember/string": "^3.0.0",
|
|
26
26
|
"@embroider/macros": "^1.8.3",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"inflection": "~1.13.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@ember-data/unpublished-test-infra": "4.6.
|
|
37
|
+
"@ember-data/unpublished-test-infra": "4.6.4",
|
|
38
38
|
"@ember/optional-features": "^2.0.0",
|
|
39
39
|
"@ember/test-helpers": "~2.7.0",
|
|
40
40
|
"broccoli-asset-rev": "^3.0.0",
|