Would a PaginatableArray accept anything else truthy than a number for total_count?

This commit is contained in:
Akira Matsuda 2015-07-24 10:01:22 +09:00
parent dadb9d249f
commit 4b2121e750
1 changed files with 2 additions and 2 deletions

View File

@ -17,11 +17,11 @@ module Kaminari
extend Kaminari::PageScopeMethods
end
if @_total_count.present? && (@_total_count <= original_array.count)
if @_total_count && (@_total_count <= original_array.count)
original_array = original_array.first(@_total_count)[@_offset_value, @_limit_value]
end
if @_total_count.nil?
unless @_total_count
original_array = original_array[@_offset_value, @_limit_value]
end