millas 0.2.14 → 0.2.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "millas",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "A modern batteries-included backend framework for Node.js — built on Express, inspired by Laravel, Django, and FastAPI",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -761,7 +761,12 @@ class Model {
761
761
  }
762
762
 
763
763
  static _hydrate(row) {
764
- return new this(row);
764
+ const fields = this.getFields();
765
+ const cast = {};
766
+ for (const [key, val] of Object.entries(row)) {
767
+ cast[key] = (fields[key]?.type === 'boolean' && val != null) ? Boolean(val) : val;
768
+ }
769
+ return new this(cast);
765
770
  }
766
771
 
767
772
  static async _hydrateFromTrx(id, trx) {