current_per_page
always reports default page size for PaginatableArray
#960
Labels
current_per_page
always reports default page size for PaginatableArray
#960
on Kaminari core 1.1.1
It seems like if one creates a PaginateableArray using
Kaminari.paginate_array
then callsper()
on thePaginateableArray
the result ofcurrent_per_page
is always the default not the value set inper
.eg
On looking into it I think this is cause
kaminari/kaminari-core/lib/kaminari/models/array_extension.rb
Line 49 in a43335c
is called by the call to
per()
, which in turn creates a new instance of thePaginateableArray
but that only sets the limit on@_limit_value
, not@_per
https://github.com/kaminari/kaminari/blob/master/kaminari-core/lib/kaminari/models/array_extension.rb#L18
However
current_per_page
returns@_per
or in the case itsnil
(which it is on the instances returned bylimit
/offset
) the default valueNot sure if maybe the fix is to change
PaginateableArray
initializer to also set@_per
tolimit
?The text was updated successfully, but these errors were encountered: