Permalink
Browse files

Fixes PostgresError when ordering with aggregation function count(*) [#…

  • Loading branch information...
1 parent 8cc2666 commit 69cc8867432554b0079a902b207bdbc8f523b286 @tj committed Dec 7, 2009
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/dm-pager/pagination.rb
@@ -40,6 +40,7 @@ def page page = nil, options = {}
:offset => (page - 1) * per_page,
:order => [:id.desc]
}.merge(query))
+ options.delete :order
options.merge! :total => count(query), :page => page
collection.pager = DataMapper::Pager.new options
collection

0 comments on commit 69cc886

Please sign in to comment.