leoric 2.0.2 → 2.0.3

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/History.md CHANGED
@@ -1,3 +1,14 @@
1
+ 2.0.3 / 2021-02-11
2
+ ==================
3
+
4
+ ## What's Changed
5
+ * fix: default updatedAt to new date if model has no createdAt by @LB4027221 in https://github.com/cyjake/leoric/pull/268
6
+
7
+ ## New Contributors
8
+ * @LB4027221 made their first contribution in https://github.com/cyjake/leoric/pull/268
9
+
10
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.0.2...v2.0.3
11
+
1
12
  2.0.2 / 2021-02-10
2
13
  ==================
3
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leoric",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "JavaScript Object-relational mapping alchemy",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
package/src/bone.js CHANGED
@@ -711,7 +711,7 @@ class Bone {
711
711
  }
712
712
 
713
713
  if (attributes[updatedAt] && !this[updatedAt]) {
714
- this[updatedAt] = this[createdAt];
714
+ this[updatedAt] = this[createdAt] || new Date();
715
715
  }
716
716
 
717
717
  const validateValues = {};