diff options
author | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-24 14:21:06 +0200 |
---|---|---|
committer | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-24 14:21:06 +0200 |
commit | f86e44d3ab8ef113dacf8d2732e4fdb9c7efef46 (patch) | |
tree | fbb450f37faa9967526c2ee616dcb3520e8ccecc | |
parent | removed the possibility to post for others from template. closes #35 (diff) | |
download | Divid-f86e44d3ab8ef113dacf8d2732e4fdb9c7efef46.tar.gz |
Posts were sorten on when added time was. This was only accurate to the minute. Now sort on created as well. Closes #43
-rw-r--r-- | models/pPost.js | 4 |
1 files 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); } |