1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

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

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