planetscale/fast_page

Question about the collection scope

ddnexus opened this issue · 1 comments

I see a suggestion in the readme:

collection.offset(pagy.offset).limit(pagy.items).fast_page

I guess you need the offset and limit chained and defined BEFORE applying fast_page, right?

If that is the case, couldn't fast_page be implemented as an extension of arel instead, which would be applied on the scope only if limit and offset are present at the execution time, and eventually a min_page specific option/condition satisfied?

Just dreaming here, but maybe it could be done, which would make fast_page even more amazing!

Thanks for the nice gem.

I'm not sure! I vaguely remember experimenting with that and I believe had challenges with making it compatible with Kaminari.

If anyone can figure it out, and maintain compatibility, sounds great. 😄