Lustra::SQL::Query::WithPagination
Constants
DEFAULT_LIMIT = 50
DEFAULT_PAGE = 1
Instance methods
first_page?
Sourcelast_page?
Sourceout_of_bounds?
Helper method that is true when someone tries to fetch a page with a larger number than the last page. Can be used in combination with flashes and redirecting.
Enter pagination mode.
This is helpful to manage paginated table.
Pagination will handle the page progression automatically and update
offset and limit parameters by his own.
page = query.paginate(2, 50)