ruby-trello icon indicating copy to clipboard operation
ruby-trello copied to clipboard

How to do pagination?

Open hakunin opened this issue 9 years ago • 5 comments

Hi, is there a way to paginate over results and hook into the pagination process?

One of the boards I am importing seems to be overflowing my app's memory limit, so I want to make sure I don't load all the cards at once.

Thanks!

hakunin avatar Jan 05 '16 08:01 hakunin

Have you tried using params supported for the card endpoint like board.cards(limit: 50)?

rossta avatar Jan 06 '16 01:01 rossta

Hi, I know there is a limit param, but how do I grab the next page and more importantly, does the gem paginete for me or not?

I tried going straight to the api using the since attribute and supplied last card's last update at attribute to it, but the API didn't return anything.

hakunin avatar Jan 06 '16 06:01 hakunin

@rossta Does the gem paginate for me if I do for instance board.cards?

hakunin avatar Jan 26 '16 09:01 hakunin

Would really appreciate advice on how to do pagination with trello if you have any :) http://stackoverflow.com/questions/34612933/how-to-paginate-trello-api-response

hakunin avatar Jan 26 '16 14:01 hakunin

@hakunin there is a room for a Paginator util class if you are up for the implementation.

runlevel5 avatar Aug 11 '16 12:08 runlevel5