All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
These are the latest changes on the project's master branch that have not yet been released.
- Breaking change: Raised minimum required Ruby version to 2.7
- Breaking change: Raised minimum required
activerecordversion to 6.0
- Test against Ruby version 3.2
- Breaking change: Ensure timestamp
order_byfields (likecreated_at) will paginate results by honoring timestamp order down to microsecond resolution on comparison. This was done by changing the cursor logic for timestamp fields, which means that the cursors strings change from version 0.3.0 to 0.4.0 and old cursors cannot be decoded by the new gem version anymore.
- Add a
limitparam to paginator that can be used instead eitherfirstorlast - Add a
max_page_sizeto the configuration, allowing to set a global limit to the page size (non overridable): Defaultnil - Support explicitly requesting all columns via
.select(*)without re-including the requested column
- Breaking change: Drop support for Ruby 2.5 (EOL 2021-03-31)
- Breaking change: Remove nesting of
ParameterErrorandInvalidCursorErrorerrors, they are now directly nested under the main gem module. So they're nowRailsCursorPagination::ParameterErrorandRailsCursorPagination::InvalidCursorError. - Refactor paginator cursor interactions into exposed
RailsCursorPagination::Cursorclass - Require multi-factor-authentication to publish the gem on Rubygems
- Breaking change: The way records are retrieved from a given cursor has been changed to no longer use
CONCATbut instead simply use a compoundWHEREclause in case of a custom order and having both the custom field as well as theidfield in theORDER BYquery. This is a breaking change since it now changes the internal order of how records with the same value of theorder_byfield are returned. - Remove
ORDER BYclause fromCOUNTqueries
- Only trigger one SQL query to load the records from the database and use it to determine if there was a previous / is a next page
- Memoize the
Paginator#pagemethod which is invoked multiple times to prevent it from mapping over therecordsagain and again and rebuilding all cursors
- Description about
order_byon arbitrary SQL to README.md
- Make the gem publicly available via github.com/xing/rails_cursor_pagination and release it to Rubygems.org
- Reference changelog file in the gemspec instead of the general releases Github tab
- Remove bulk from release: The previous gem releases contained files like the content of the
binfolder or the Gemfile used for testing. Since this is not useful for gem users, adjust the gemspec file accordingly.
- Pagination for relations in which a custom
SELECTdoes not contain cursor-relevant fields like:idor the field specified viaorder_by
- Add support for handling
nilfororderandorder_byvalues as if they were not passed
- Pagination for relations that use a custom
SELECT
- First version of the gem, including pagination, custom ordering by column and sort-order.