Api Pagination Versions Save

:page_facing_up: Link header pagination for Rails and Grape APIs.

v5.0.0

2 years ago

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.

v4.8.2

5 years ago

This release fixes an incompatibility with Grape 1.2. Thanks to @fotos for this fix!

v4.8.1

5 years ago

4.8.1

  • Added support for the Pagy gem

v4.7.1

6 years ago

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

v4.7.0

6 years ago

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

v4.6.3

6 years ago

Fix a regression that broke compatibility with multi-word classes (#84)

v4.6.2

6 years ago

Removes a superfluous database query (#82)

v4.6.1

6 years ago

Fixes an issue with will_paginate where unsupported options were passed

v4.6.0

6 years ago
  • Fix behavior related to a new implementation of last_page? in Kaminari (#78)
  • Allow passing additional options to paginate when using will_paginate (#81)

v4.5.2

7 years ago

Fix an issue where Total headers supplied as non-String values would cause exceptions in Rack