我正在使用Kaminari对连接表进行排序:
Hippy.includes(:flowers) # => 535
使用此代码:
Hippy.includes(:flowers).page(1).per(50).count # => 50
当我按升序排序时,我在11页上每页得到1条记录,这是我不期望的:
Hippy.includes(:flowers).order("flowers.id asc").page(1).per(50).count # => 1
Hippy.includes(:flowers).order("flowers.id asc").page(1).per(50).total_pages # => 11
撤销订单,我得到:
Hippy.includes(:flowers).order("flowers.id desc").page(1).per(50).count # => 5
Hippy.includes(:flowers).order("hippies.id desc").page(1).per(50).total_pages # => 50
在连接表订购时,Kaminari不工作吗?或者我做错了什么?