Skip to content

Commit 366fd4d

Browse files
committed
Use float arithmetic to calculate the pages
1 parent b9d7288 commit 366fd4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)