From 2acb546028bfe3ba936c8889d65a922d348842dd Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 15 Oct 2013 11:09:08 -0500 Subject: [PATCH] Fix #896 - work around errors in pagination under Postgresql. --- core/server/models/post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/models/post.js b/core/server/models/post.js index 111c32fff9..2902b2f678 100644 --- a/core/server/models/post.js +++ b/core/server/models/post.js @@ -258,7 +258,7 @@ Post = GhostBookshelf.Model.extend({ } return qb.count(_.result(collection, 'idAttribute')).then(function (resp) { - var totalPosts = resp[0].aggregate, + var totalPosts = parseInt(resp[0].aggregate, 10), data = { posts: collection.toJSON(), page: parseInt(opts.page, 10),