Skip to content

Commit

Permalink
Order getLatest images ascending
Browse files Browse the repository at this point in the history
this will make the images without updated_at to stay at the bottom
  • Loading branch information
miro committed Feb 1, 2016
1 parent 27a1186 commit 9988256
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ controller.getLatest = function() {
return db.models.Image.forge()
.query('where', 'spotId', '<>', 0) // hack to achieve "not null"
.query('where', 'riderId', '<>', 0)
.query('orderBy', 'updated_at', 'desc')
.query('orderBy', 'updated_at')
.query('limit', AMOUNT_OF_PICS_TO_RETURN)
.fetchAll({ withRelated: [
'rider', 'photographer', 'spot', 'organisation'
Expand Down

0 comments on commit 9988256

Please sign in to comment.