Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use without_count by default #1038

Open
fmluizao opened this issue Oct 26, 2020 · 1 comment
Open

Use without_count by default #1038

fmluizao opened this issue Oct 26, 2020 · 1 comment

Comments

@fmluizao
Copy link

fmluizao commented Oct 26, 2020

Hi,

I'm using v1.2.1, and trying to monkey patch to always use without_count, but no success. I was trying something like this in an initializer:

Kaminari::ActiveRecordRelationMethods.extend(Kaminari::PaginatableWithoutCount)

But it seems that the initialization already happened (page method was created before my patch gets applied).

Any ideas how I can achieve that?

An option to always use without_count would be perfect, but I can live with a small monkey patch 😄

Related issue: #944

@ruurd
Copy link
Contributor

ruurd commented Dec 21, 2020

If you want to do pagination without counting make sure that you use the sort order in which the entries are displayed to do the paging. Paging without OFFSET is doable if the only order in which you display entries is done on an always available column in a table. Doing this when developers use a different gem to order (and select) entries to display is much harder than you think.

Maybe it's time to band together with the ransack people and start adding ActiveOrdering to Rails to make that happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants