Skip to content

Commit 03bbc68

Browse files
committed
Always return a String for the Total header
Rack seems to expect that header values will always be a String, and apparently Rails does not do appropriate conversion. We should just make sure that the method to calculate the Total header returns a String. This fixes #6 Signed-off-by: David Celis <[email protected]>
1 parent 3f2dbf7 commit 03bbc68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/api-pagination.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def pages_from(collection)
3333

3434
def total_from(collection)
3535
case ApiPagination.paginator
36-
when :kaminari then collection.total_count
37-
when :will_paginate then collection.total_entries
36+
when :kaminari then collection.total_count.to_s
37+
when :will_paginate then collection.total_entries.to_s
3838
end
3939
end
4040
end

0 commit comments

Comments
 (0)