Skip to content

Commit

Permalink
SONAR-5998 Fail to render the measures page when the parameter pageSi…
Browse files Browse the repository at this point in the history
…ze does not contain an integer
  • Loading branch information
julienlancelot committed Feb 12, 2015
1 parent a2af42a commit 5288f5b
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -34,13 +34,16 @@ class Api::Pagination
attr_accessor :page_entries

def initialize(options={})
@per_page=options[:per_page]||DEFAULT_PER_PAGE
@per_page=options[:per_page].to_i||DEFAULT_PER_PAGE
@page=options[:page].to_i
@page=1 if @page<1
@count = options[:count].to_i
end

def pages
if per_page <= 0
return 0
end
p=(count / per_page)
p+=1 if count % per_page>0
p
Expand Down

0 comments on commit 5288f5b

Please sign in to comment.