From 1f28f877cf23dcece9f21fce0e1909dfa8d2aa05 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Wed, 24 Jun 2015 08:25:34 -0700 Subject: [PATCH] fix remove mongoose specific function --- server/boot/story.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/boot/story.js b/server/boot/story.js index 3dd1019b34..b1b1f11b9c 100755 --- a/server/boot/story.js +++ b/server/boot/story.js @@ -234,14 +234,11 @@ module.exports = function(app) { return next(err); } story = story.pop(); - story.rank++; - story.upVotes.push( - { - upVotedBy: req.user.id, - upVotedByUsername: req.user.username - } - ); - story.markModified('rank'); + story.rank += 1; + story.upVotes.push({ + upVotedBy: req.user.id, + upVotedByUsername: req.user.username + }); story.save(); // NOTE(Berks): This logic is full of wholes and race conditions // this could be the source of many 'can't set headers after