aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/models/pPost.js
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-24 14:21:06 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-24 14:21:06 +0200
commitf86e44d3ab8ef113dacf8d2732e4fdb9c7efef46 (patch)
treefbb450f37faa9967526c2ee616dcb3520e8ccecc /models/pPost.js
parentremoved the possibility to post for others from template. closes #35 (diff)
downloadDivid-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
Diffstat (limited to 'models/pPost.js')
-rw-r--r--models/pPost.js4
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);
}