Skip to content
Snippets Groups Projects
Commit e1a86084 authored by P1384's avatar P1384
Browse files

Update Comment.js, line 7

parent 52e8ee48
No related branches found
No related tags found
No related merge requests found
Pipeline #281585 passed
......@@ -4,7 +4,7 @@ var CommentSchema = new mongoose.Schema({
body: String,
author: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
article: { type: mongoose.Schema.Types.ObjectId, ref: 'Article' }
}, {timestamps: true});
}, {timestamps: true, usePushEach: true});
// Requires population of author
CommentSchema.methods.toJSONFor = function(user){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment