Merge pull request #1088 from jacobian/postgres-fix

Fix #896 - work around errors in pagination under Postgresql.
This commit is contained in:
Hannah Wolfe 2013-10-22 07:08:15 -07:00
commit 4480d3bd02

View File

@ -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),