Skip to content

Commit 51738cb

Browse files
committed
Fix: set mandatory modelName
1 parent 130ca42 commit 51738cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/model.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const models = {};
22

33
function model(data, modelName) {
4-
if(!data) {
4+
if(!data || (!this.modelName && !modelName)) {
55
return this;
66
}
7-
7+
88
// ToDo: Validate model
99
// ToDo: Check if model already exists to merge instead of set
1010
var name = this.modelName || modelName;

0 commit comments

Comments
 (0)