Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@radiokills
Copy link

Hey, I'm submitting the PR that adds a warning when no ordering is in place.

This code is connected to the following:
#1042 and
#1040 (I think this one explains the issue well enough)

This code will for sure screw the test output quite a bit but for a good reason.
I mean, for sure the correct ordering is the responsibility of the developer who uses this gem, however, I believe in this case it is easily missed, especially because there is (still) no warning in the documentation, also the existing tests don't offer a good practice example. (I am prepared to fix existing tests as well, please let me know if this PR is acceptable. )

Not using ordering, can lead to some nasty consequences especially when Kaminari is used in an API.

There is also another option to resolve this issue (albeit more intrusive):
The default order by column could be added to the config and then prepend it to the 'page' scope.
(Another variant would be to use the primary key of the model if exists)

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

Successfully merging this pull request may close these issues.

1 participant