@kaspernj/api-maker 1.0.144 → 1.0.145
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/.eslintrc.js +1 -0
- package/package.json +1 -1
- package/src/base-model.cjs +5 -3
package/.eslintrc.js
CHANGED
package/package.json
CHANGED
package/src/base-model.cjs
CHANGED
|
@@ -366,8 +366,8 @@ class BaseModel {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
isNewRecord () {
|
|
369
|
-
if (this.newRecord
|
|
370
|
-
return
|
|
369
|
+
if (this.newRecord !== undefined) {
|
|
370
|
+
return this.newRecord
|
|
371
371
|
} else if ("id" in this.modelData && this.modelData.id) {
|
|
372
372
|
return false
|
|
373
373
|
} else {
|
|
@@ -676,7 +676,9 @@ class BaseModel {
|
|
|
676
676
|
if (attributeName in attributes) return null
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
-
|
|
679
|
+
if (this.isPersisted()) {
|
|
680
|
+
throw new AttributeNotLoadedError(`No such attribute: ${digg(this.modelClassData(), "name")}#${attributeName}: ${JSON.stringify(this.modelData)}`)
|
|
681
|
+
}
|
|
680
682
|
}
|
|
681
683
|
|
|
682
684
|
isAttributeLoaded (attributeName) {
|