cormo
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -620,2 +620,18 @@ "use strict"; | ||
}); | ||
if (this.query_record_id_as_string) { | ||
for (const column of Object.keys(this._schema)) { | ||
const property = this._schema[column]; | ||
if (property && property.record_id && !property.primary_key) { | ||
const value = record[column]; | ||
if (value) { | ||
if (property.array) { | ||
record[column] = value.map((item) => (item ? String(item) : null)); | ||
} | ||
else { | ||
record[column] = String(value); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
@@ -978,2 +994,18 @@ return records; | ||
}); | ||
if (ctor.query_record_id_as_string) { | ||
for (const column of Object.keys(ctor._schema)) { | ||
const property = ctor._schema[column]; | ||
if (property && property.record_id && !property.primary_key) { | ||
const value = this.get(column); | ||
if (value) { | ||
if (property.array) { | ||
this.set(column, value.map((item) => (item ? String(item) : null))); | ||
} | ||
else { | ||
this.set(column, String(value)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
Object.defineProperty(this, '_is_persisted', { | ||
@@ -980,0 +1012,0 @@ configurable: false, |
{ | ||
"name": "cormo", | ||
"description": "ORM framework for Node.js", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"keywords": [ | ||
@@ -70,3 +70,3 @@ "orm", | ||
}, | ||
"gitHead": "241443c816ab43c1b1ff8f54aa8ad6ce2be5e7bf" | ||
"gitHead": "123a59eb57487e2d787c18d6598a7849d9f66abd" | ||
} |
387493
10576