Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#909·kaminari

`total_pages` should always return >0

Author: To1neCreated Aug 18, 2017Updated Aug 13, 2025
LabelsFeedback Needed

When there are no records, Kaminari::PageScopeMethods#total_pages should return 1, instead of 0.

It doesn't make sense to return 0 as the number of pages, since current_page also returns 1 when there are no records.

Source: kaminari/kaminari

View original on GitHubView discussion on GitHub