mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
"calculable" 🤦♂️
This commit is contained in:
parent
c5aca2f5a2
commit
7b0a0122c0
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ module Kaminari
|
|||
if loaded?
|
||||
# Total count has to be 0 if loaded records are 0
|
||||
return @total_count = 0 if (current_page == 1) && @records.empty?
|
||||
# Total count is calculatable at the last page
|
||||
# Total count is calculable at the last page
|
||||
per_page = (defined?(@_per) && @_per) || default_per_page
|
||||
return @total_count = (current_page - 1) * per_page + @records.length if @records.any? && (@records.length < per_page)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue