Uysim / pagy-cursor

Cursor pagination with pagy for Ruby On Rails
MIT License
126 stars 23 forks source link

Has more without querying again #19

Closed yunanhelmy closed 4 years ago

yunanhelmy commented 4 years ago

Hello @Uysim ,

Apologies for the delay.

I've tried to implement has_more without re-querying. The idea is by querying pagy.items + 1 and check whether collection.size > pagy.items. The return will become items[0..pagy.items-1] in order to correctly return the pagination result.

Please let me know your feedback.

Thank you

Uysim/pagy-cursor#15