Releases: davidcelis/api-pagination
Releases · davidcelis/api-pagination
6.0.0
5.0.0
This release fixes issues with using newer versions of Pagy, due to them renaming Pagy::VARS
to Pagy::DEFAULT
. Consequently, support for older versions of Pagy is dropped.
4.8.2
4.8.1
4.7.1
Add an :enforce_max_per_page
option to pagination in Grape APIs:
class MoviesAPI < Grape::API
format :json
desc 'Return a paginated set of movies'
paginate per_page: 25, max_per_page: 100, enforce_max_per_page: true
get do
# If a client tries to make a request with a `per_page` param that is above 100,
# no movies will be returned. Instead, a client error will be returned.
paginate Movie.all
end
end
4.7.0
This release allows users to configure a hardcoded base URL for pagination links in the case where your application is reachable at multiple URLs and, for example, caching is used. If your application is only available at specific hostnames for specific users, caching these headers can lead to unexpected results. You can set a base URL using the following configuration:
ApiPagination.configure do |config|
# Hardcode a URL to use in your pagination links (without a trailing slash)
config.base_url = 'https://example.com'
end
4.6.3
4.6.2
4.6.1
Fixes an issue with will_paginate where unsupported options were passed