Skip to content

Commit 8250589

Browse files
committed
Merge pull request github#1030 from Shredder121/pagination
Use float arithmetic to calculate the pages
2 parents c54c2e9 + 366fd4d commit 8250589

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/changes_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module ChangesHelper
2-
PER_PAGE = 10
2+
PER_PAGE = 10.0
33

44
def add_created_at_attribute
55
@items.each do |item|
@@ -42,7 +42,7 @@ def paginated_api_changes(first, last, version = nil)
4242
end
4343

4444
def total_pages(version = nil)
45-
(api_changes(version).length / PER_PAGE).floor
45+
(api_changes(version).length / PER_PAGE).ceil
4646
end
4747

4848
# Public

0 commit comments

Comments
 (0)