-
Notifications
You must be signed in to change notification settings - Fork 52
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
Properly set limit
in Kaminari
#395
Conversation
Fixes regression in meilisearch#376 Fixes meilisearch#394
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #395 +/- ##
==========================================
+ Coverage 89.19% 89.20% +0.01%
==========================================
Files 13 13
Lines 768 769 +1
==========================================
+ Hits 685 686 +1
Misses 83 83 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
offset = 0 if offset.nil? | ||
limit = 0 if options[:per_page].nil? | ||
array = new results, limit: limit, offset: offset, total_count: total_hits | ||
unless MeiliSearch::Rails.active? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless MeiliSearch::Rails.active? | |
unless Meilisearch::Rails.active? |
To maintain compatibility with #384
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would if I knew which one would be merged first... Besides, there could be a patch level release with this PR while the rename is done in 0.15, that way 0.14 can have a stabler final version.
Out of pure curiosity, why is the limit being set by default to |
@wesharper The specific value of the limit doesn't matter, it's really an extension of the NullObject pattern that this gem uses when you disable Meilisearch, I used The problem this solves is the NullObject returns itself however you interact with it, and those instances end up in Kaminari causing all kinds of trouble. See #375 Edit: |
Thanks for the context, @ellnix. |
bors merge |
Build succeeded: |
Fixes regression in #376
Fixes #394