Skip to content

Commit

Permalink
closes #117 - published order
Browse files Browse the repository at this point in the history
Fixes the knex query so that posts are correctly returned in the order of published_at, desc
  • Loading branch information
ErisDS committed Jun 16, 2013
1 parent 49999a7 commit 17c8c02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/shared/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
limit: 15,
where: {},
status: 'published',
orderBy: 'published_at DESC'
orderBy: ['published_at', 'DESC']
}, opts);

postCollection = Posts.forge();
Expand All @@ -121,7 +121,7 @@
return postCollection
.query('limit', opts.limit)
.query('offset', opts.limit * (opts.page - 1))
.query('orderBy', opts.orderBy)
.query('orderBy', opts.orderBy[0], opts.orderBy[1])
.fetch(_.omit(opts, 'page', 'limit', 'where', 'status', 'orderBy'))
.then(function (collection) {
var qb;
Expand Down

0 comments on commit 17c8c02

Please sign in to comment.