Skip to content

Releases: davidcelis/api-pagination

4.5.2

29 Dec 15:41
Compare
Choose a tag to compare

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

4.5.1

08 Dec 20:51
Compare
Choose a tag to compare

Move the definition of ApiPagination::Hooks to fix booting in Rails 3 and 4 environments (#72)

4.5.0

05 Dec 18:50
Compare
Choose a tag to compare

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

13 Sep 20:38
Compare
Choose a tag to compare

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

12 Feb 01:04
Compare
Choose a tag to compare

Warnings about including both Kaminari and WillPaginate are now deferred until ApiPagination.config.paginator is called.

3.2.1

12 Feb 01:04
Compare
Choose a tag to compare

Warnings about including both Kaminari and WillPaginate are now deferred until ApiPagination.config.paginator is called.

4.1.0

30 Jan 21:39
Compare
Choose a tag to compare

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

30 Jan 21:38
Compare
Choose a tag to compare

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

13 Jan 00:48
Compare
Choose a tag to compare

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.

3.1.0

21 Sep 19:25
Compare
Choose a tag to compare
  • #15: Allow paginate to directly accept a collection and return the paginated collection itself instead of implicitly rendering (an implicit render will still happen if the call to paginate mimics a call to render)
  • #14: Avoid dividing by 0 (thanks to @macb)