summaryrefslogtreecommitdiffstats
path: root/models/announcements.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/announcements.js')
-rw-r--r--models/announcements.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/announcements.js b/models/announcements.js
index c08710b8..7fdf8d8b 100644
--- a/models/announcements.js
+++ b/models/announcements.js
@@ -25,6 +25,8 @@ Announcements.attachSchema(
autoValue() {
if (this.isInsert) {
return new Date();
+ } else if (this.isUpsert) {
+ return { $setOnInsert: new Date() };
} else {
this.unset();
}