Module: ActiveRecordCursorPaginate::Extension
- Defined in:
- lib/activerecord_cursor_paginate/extension.rb
Instance Method Summary collapse
-
#cursor_paginate(after: nil, before: nil, limit: nil, order: nil, append_primary_key: true) ⇒ ActiveRecordCursorPaginate::Paginator
(also: #cursor_pagination)
Convenient method to use on ActiveRecord::Relation to get a paginator.
Instance Method Details
#cursor_paginate(after: nil, before: nil, limit: nil, order: nil, append_primary_key: true) ⇒ ActiveRecordCursorPaginate::Paginator Also known as: cursor_pagination
Convenient method to use on ActiveRecord::Relation to get a paginator.
13 14 15 16 |
# File 'lib/activerecord_cursor_paginate/extension.rb', line 13 def cursor_paginate(after: nil, before: nil, limit: nil, order: nil, append_primary_key: true) relation = (is_a?(ActiveRecord::Relation) ? self : all) Paginator.new(relation, after: after, before: before, limit: limit, order: order, append_primary_key: append_primary_key) end |