Uysim / pagy-cursor

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

Ordering collection other than primary key #13

Closed yunanhelmy closed 4 years ago

yunanhelmy commented 4 years ago

Hi @Uysim ,

Do you think it's proper to add feature so that collection can be ordered other than its primary key?

Usually cursor based pagination is using its PK. But in my case I need to order it by another field.

Can you please advise?

I haven't made any PR. I made some patch here https://github.com/yunanhelmy/pagy-cursor/commit/79a336874d0598c589529d3a8765f298a9936131. I would be glad if you could review it.

Thank you

Uysim commented 4 years ago

@yunanhelmy Sorry for late reply. If we check the article here in Shopify Engineer Blog. At section order, I think it is possible. Happy to get your pull request

yunanhelmy commented 4 years ago

Thanks. Can you please review PR https://github.com/Uysim/pagy-cursor/pull/14 @Uysim ?