Skip to content

Commit

Permalink
Fix regression in fadc4b3d; total_count is not the same as total_pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 25, 2014
1 parent 1334888 commit fc994f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/blacklight/solr/facet_paginator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def has_previous?
deprecation_deprecate :has_next?

def last_page?
total_count <= limit
current_page >= total_pages
end

def first_page?
Expand All @@ -93,7 +93,11 @@ def first_page?
# know the total number of pages.
# https://github.com/amatsuda/kaminari/blob/v0.16.1/lib/kaminari/models/page_scope_methods.rb#L21
def total_pages
-1
if limit == 0 #check for divide by zero
1
else
(total_count.to_f / limit).ceil
end
end

# Pass in a desired solr facet solr key ('count' or 'index', see
Expand Down

0 comments on commit fc994f2

Please sign in to comment.