@rws-framework/db 4.1.3 → 4.1.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.
|
@@ -19,7 +19,8 @@ function Relation(theModel, relationOptions = _DEFAULTS) {
|
|
|
19
19
|
relationOptions.relationName :
|
|
20
20
|
null
|
|
21
21
|
};
|
|
22
|
-
if
|
|
22
|
+
// Only set default cascade behavior if no explicit cascade was provided
|
|
23
|
+
if (relationOptions.required && !relationOptions.cascade) {
|
|
23
24
|
if (!metaOpts.cascade) {
|
|
24
25
|
metaOpts.cascade = {};
|
|
25
26
|
}
|
package/package.json
CHANGED
|
@@ -43,7 +43,8 @@ function Relation(theModel: () => OpModelType<RWSModel<any>>, relationOptions: P
|
|
|
43
43
|
null
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
if
|
|
46
|
+
// Only set default cascade behavior if no explicit cascade was provided
|
|
47
|
+
if(relationOptions.required && !relationOptions.cascade){
|
|
47
48
|
if(!metaOpts.cascade){
|
|
48
49
|
metaOpts.cascade = {};
|
|
49
50
|
}
|