I have 2 stored procedures wich return data with limit and offset and count of all records.
How can I use Kaminari for pagination in this case ?
UPD
I have problem with kaminari in edge version! I have abstract class MyRecord extended from ActiveRecord, other models extends this abstract class.
class Customer < MyRecord
has_one :active_order, :class_name => 'Order',
:conditions => {
:status_type => [Order::STATUS_TYPES[:active],Order::STATUS_TYPES[:paused]]
}
…….
controller
@customers = Customer.search(params[:search]).includes(:active_order).order(sort_column + ' ' + sort_direction).page(params[:page]).per(25)
I get now wrong query (abstract class table name instead of model table name)
SELECT `my_records`.* FROM `my_records` WHERE
(`my_records`.customer_id IN (160,161,162,163,164,165,166,167,168,169,170)
AND (`my_records`.`status_type` IN (0, 2)))
Just added a new feature on Kaminari::PaginatableArray that would solve your problem.
https://github.com/amatsuda/kaminari/pull/141
Can you bundle the edge version of Kaminari:
and pass
:total_countoption toPaginatableArray#newlike this?or