"calculable" 🤦‍♂️

This commit is contained in:
Akira Matsuda 2017-01-05 01:22:08 +09:00
parent c5aca2f5a2
commit 7b0a0122c0
1 changed files with 1 additions and 1 deletions

View File

@ -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