Releases: davidcelis/api-pagination
4.5.2
Fix an issue where Total
headers supplied as non-String values would cause exceptions in Rack
4.5.1
4.5.0
Add support for Rails 5.
NOTE: The Rails::Pagination
module will no longer be mixed into ActionController::Base
if ActionController::API
is also defined. If for any reason your API controllers cannot easily changed be changed to inherit from ActionController::API
instead, you can manually include Rails::Pagination
in your API's ApplicationController
.
4.4.0
api-pagination now allows developers to manually set a total_page
when paginating Arrays. This is useful when paginating results from external services such as ElasticSearch or other APIs, where you are dealing with Arrays of already-paginated results as opposed to an ActiveRecord collection:
total_count = $redis.llen "ratings"
page, per_page = params.fetch(:page, 1), params.fetch(:per_page, 25)
start = (page - 1) * per_page
results = $redis.lrange "ratings", start, start + per_page
paginate results, paginate_array_options: { total_count: total_count }
4.1.1
Warnings about including both Kaminari and WillPaginate are now deferred until ApiPagination.config.paginator
is called.
3.2.1
Warnings about including both Kaminari and WillPaginate are now deferred until ApiPagination.config.paginator
is called.
4.1.0
Add ApiPagination::Configuration
Add a configuration object that handles names of Total and Per-Page
headers, as well as allows for the manual setting of the paginator that
ApiPagination will use. It's up to the user to make WillPaginate and
Kaminari play nicely together if they include both.
3.2.0
Add ApiPagination::Configuration
Add a configuration object that handles names of Total and Per-Page
headers, as well as allows for the manual setting of the paginator that
ApiPagination will use. It's up to the user to make WillPaginate and
Kaminari play nicely together if they include both.
4.0.0
This release includes compatibility for recent versions of Grape (0.10.0 and later). Unfortunately this is not backwards compatible with previous Grape versions. If using Grape 0.9.x or earlier, continue using api-pagination 3.1.x. This will continue to receive bug fixes.