- Fix
Paginator#total_countto not change when paginating - Fix
Paginator#limitto return default page size by default
-
Add ability to paginate backward from the end of the collection
paginator = users.cursor_paginate(forward_pagination: false)
-
Allow paginating over nullable columns
Previously, the error was raised when cursor values contained
nils. Now, it is possible to paginate over columns containingnilvalues. You need to explicitly configure which columns are nullable, otherwise columns are considered as non-nullable by the gem.paginator = users.cursor_paginate(order: [:name, :id], nullable_columns: [:name])
Note that it is not recommended to use this feature, because the complexity of produced SQL queries can have a very negative impact on the database performance. It is better to paginate using only non-nullable columns.
-
Fix paginating over relations with joins, includes and custom ordering
-
Add ability to incrementally configure a paginator
-
Add ability to get the total number of records
paginator = posts.cursor_paginate paginator.total_count # => 145
-
Fix prefixing selected columns when iterating over joined tables
-
Change cursor encoding to url safe base64
-
Fix
next_cursor/previous_cursorfor empty pages -
Fix iterating using only a timestamp column
-
Add the ability to skip implicitly appending a primary key to the list of sorting columns.
It may be useful to disable it for the table with a UUID primary key or when the sorting is done by a combination of columns that are already unique.
paginator = UserSettings.cursor_paginate(order: :user_id, append_primary_key: false)
- First release