summaryrefslogtreecommitdiffstats
path: root/models/rules.js
diff options
context:
space:
mode:
authorJustin Reynolds <justinr1234@gmail.com>2019-09-05 12:29:45 -0500
committerJustin Reynolds <justinr1234@gmail.com>2019-09-05 12:29:45 -0500
commit3b9f2ca7c2fffa230bb0c6d4254a88deb9fbb023 (patch)
tree356ab6f5693852464bdb975934c53f63445e6d5f /models/rules.js
parent2c78aab3dc91ee276bfb5e4717ada72dc84ca3b0 (diff)
downloadwekan-3b9f2ca7c2fffa230bb0c6d4254a88deb9fbb023.tar.gz
wekan-3b9f2ca7c2fffa230bb0c6d4254a88deb9fbb023.tar.bz2
wekan-3b9f2ca7c2fffa230bb0c6d4254a88deb9fbb023.zip
Fixes #2596 incorrect date types for created & updated
Diffstat (limited to 'models/rules.js')
-rw-r--r--models/rules.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/rules.js b/models/rules.js
index 202071fc..2e6729cc 100644
--- a/models/rules.js
+++ b/models/rules.js
@@ -27,6 +27,8 @@ Rules.attachSchema(
autoValue() {
if (this.isInsert) {
return new Date();
+ } else if (this.isUpsert) {
+ return { $setOnInsert: new Date() };
} else {
this.unset();
}