From f86e44d3ab8ef113dacf8d2732e4fdb9c7efef46 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 24 May 2013 14:21:06 +0200 Subject: Posts were sorten on when added time was. This was only accurate to the minute. Now sort on created as well. Closes #43 --- models/pPost.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/pPost.js b/models/pPost.js index c6def28..d36eb36 100644 --- a/models/pPost.js +++ b/models/pPost.js @@ -52,7 +52,7 @@ pPostSchema.statics = { loadProject: function(project, callback) { this.find({ project: project }) .populate('user') - .sort({ 'when': -1 }) + .sort({ 'when': -1, 'created': -1 }) .exec(callback); }, @@ -70,7 +70,7 @@ pPostSchema.statics = { .populate({ path: 'user', select: 'name email status' }) .populate({ path: 'project', select: 'name shortURL' }) .limit(10) - .sort({ 'when': -1 }) + .sort({ 'when': -1, 'created': -1 }) .exec(callback); } -- cgit v1.2.3