rails_cursor_pagination
rails_cursor_pagination copied to clipboard
Allow disabling previous and next page checks
trafficstars
Problem
When we use this gem it causes two count queries before the actual query happens. But because of performance reasons we want to avoid having these count queries. So I would like to propose this PR (or something similar).
Reason
The previous_page? and next_page? methods in certain cases require a count query in order to determine if the next/previous pages exists. These count queries can be expensive so an option to disable these checks are added.
For backwards compatibility these checks are enabled by default.