merge master

This commit is contained in:
riley
2017-05-22 13:10:43 -06:00
105 changed files with 2436 additions and 435 deletions
-7
View File
@@ -4,8 +4,6 @@ const TagLinkSchema = require('./schema/tag_link');
const uuid = require('uuid');
const COMMENT_STATUS = require('./enum/comment_status');
const EDIT_WINDOW_MS = 30 * 1000; // 30 seconds
/**
* The Mongo schema for a Comment Status.
* @type {Schema}
@@ -97,12 +95,7 @@ CommentSchema.virtual('edited').get(function() {
return this.body_history.length > 1;
});
CommentSchema.virtual('editableUntil').get(function() {
return new Date(Number(this.created_at) + EDIT_WINDOW_MS);
});
// Comment model.
const Comment = mongoose.model('Comment', CommentSchema);
module.exports = Comment;
module.exports.EDIT_WINDOW_MS = EDIT_WINDOW_MS;