ember-m3
Advanced tools
Comparing version 5.0.4 to 5.0.5
@@ -292,6 +292,16 @@ import { dasherize } from '@ember/string'; | ||
} | ||
if ( | ||
!recordData.getServerAttr || | ||
(recordData.getServerAttr(key) !== null && recordData.getServerAttr(key) !== undefined) | ||
) { | ||
// Detect whether the nested model itself is replaced or new, e.g. from a user having done | ||
// `model.set('nestedModel', { ...newAttributes });` | ||
let createDirtyNestedModel = | ||
recordData.__attributes && Object.keys(recordData.__attributes).indexOf(key) >= 0; | ||
// Detect whether creating model from server payload | ||
createDirtyNestedModel &&= recordData.getServerAttr && !recordData.getServerAttr(key); | ||
if (createDirtyNestedModel) { | ||
Object.keys(nestedValue.attributes).forEach((key) => { | ||
nestedRecordData.setAttr(key, nestedValue.attributes[key], true); | ||
}); | ||
} else { | ||
nestedRecordData.pushData( | ||
@@ -305,6 +315,2 @@ { | ||
); | ||
} else { | ||
Object.keys(nestedValue.attributes).forEach((key) => { | ||
nestedRecordData.setAttr(key, nestedValue.attributes[key], true); | ||
}); | ||
} | ||
@@ -311,0 +317,0 @@ |
@@ -7,2 +7,15 @@ | ||
## v5.0.5 (2022-05-10) | ||
#### :bug: Bug Fix | ||
* [#1601](https://github.com/hjdivad/ember-m3/pull/1601) Fix lazy nested model creation for newly written attributes ([@larry-x-yu](https://github.com/larry-x-yu)) | ||
#### :house: Internal | ||
* [#1607](https://github.com/hjdivad/ember-m3/pull/1607) Move feature-flags from CI to nightly ([@hjdivad](https://github.com/hjdivad)) | ||
#### Committers: 2 | ||
- David J. Hamilton ([@hjdivad](https://github.com/hjdivad)) | ||
- [@larry-x-yu](https://github.com/larry-x-yu) | ||
## v5.0.4 (2022-01-12) | ||
@@ -9,0 +22,0 @@ |
{ | ||
"name": "ember-m3", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"isCanary": false, | ||
@@ -71,4 +71,4 @@ "description": "Alternative to @ember-data/model in which attributes and relationships are derived from API Payloads", | ||
"devDependencies": { | ||
"@commitlint/cli": "^16.0.2", | ||
"@commitlint/travis-cli": "^16.0.1", | ||
"@commitlint/cli": "^16.1.0", | ||
"@commitlint/travis-cli": "^16.0.3", | ||
"@ember-data/debug": "4.1.0", | ||
@@ -84,4 +84,4 @@ "@ember-data/model": "4.1.0", | ||
"broccoli-asset-rev": "^3.0.0", | ||
"ember-auto-import": "^2.2.3", | ||
"ember-cli": "~4.1.0", | ||
"ember-auto-import": "^2.4.0", | ||
"ember-cli": "~4.1.1", | ||
"ember-cli-dependency-checker": "^3.0.0", | ||
@@ -111,3 +111,3 @@ "ember-cli-htmlbars": "^6.0.1", | ||
"husky": "^7.0.4", | ||
"lint-staged": "^12.1.7", | ||
"lint-staged": "^12.3.2", | ||
"loader.js": "^4.2.3", | ||
@@ -118,6 +118,6 @@ "moment": "^2.29.1", | ||
"qunit": "^2.17.2", | ||
"release-it": "^14.12.1", | ||
"release-it": "^14.12.4", | ||
"release-it-lerna-changelog": "^4.0.1", | ||
"testem": "^3.6.0", | ||
"webpack": "^5.65.0" | ||
"webpack": "^5.67.0" | ||
}, | ||
@@ -124,0 +124,0 @@ "engines": { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
235092
4950
13