We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b93cee9 commit 968ad4cCopy full SHA for 968ad4c
lib/api-pagination.rb
@@ -10,7 +10,7 @@ def paginate(collection, options = {})
10
case ApiPagination.paginator
11
when :kaminari
12
options[:per_page] = (options[:per_page].to_i <= 0 ? Kaminari.config.default_per_page : options[:per_page])
13
- options[:per_page] = (options[:per_page].to_i > Kaminari.config.max_per_page ? Kaminari.config.max_per_page : options[:per_page])
+ options[:per_page] = (options[:per_page].to_i > Kaminari.config.max_per_page && Kaminari.config.max_per_page ? Kaminari.config.max_per_page : options[:per_page])
14
collection = Kaminari.paginate_array(collection) if collection.is_a?(Array)
15
collection.page(options[:page]).per(options[:per_page])
16
when :will_paginate
0 commit comments