More tests.

This commit is contained in:
gaba
2016-12-12 15:38:28 -08:00
parent 83a7ffee6f
commit 0648b2b1c8
6 changed files with 74 additions and 20 deletions
+9 -1
View File
@@ -29,6 +29,14 @@ const AssetSchema = new Schema({
type: Schema.Types.Mixed,
default: null
},
closedAt: {
type: Date,
default: null
},
closedMessage: {
type: String,
default: null
},
title: String,
description: String,
image: String,
@@ -69,7 +77,7 @@ AssetSchema.statics.findById = (id) => Asset.findOne({id});
AssetSchema.statics.findByUrl = (url) => Asset.findOne({url});
AssetSchema.virtual('isClosed').get(function() {
return this.settings && this.settings.closedAt && this.settings.closedAt <= new Date().getTime();
return this.closedAt && this.closedAt.getTime() <= new Date().getTime();
});
/**