Permalink
Browse files

Merge pull request #173 from webjay/master

Fix natural sorting
  • Loading branch information...
2 parents 287477f + c277809 commit c87a8259b0a7c5dfaff79171517425cf3b1f8704 @drudge drudge committed Mar 19, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/queue/job.js
View
@@ -1,4 +1,3 @@
-
/*!
* kue - Job
* Copyright (c) 2011 LearnBoost <tj@learnboost.com>
@@ -58,6 +57,9 @@ function map(jobs, ids){
ids.forEach(function(id){
if (jobs[id]) ret.push(jobs[id]);
});
+ ret = ret.sort(function (a, b) {
+ return parseInt(a.id) - parseInt(b.id);
+ });
return ret;
}

0 comments on commit c87a825

Please sign in to comment.