mislav/will_paginate — Issue #222: total entries count fails when including a table with a natural primary key
Author: andreacfm
Created: 2012-01-11 15:57:02+00:00
State: open

I have a model ( say model_a ) that has a relation like:

belongs_to :model_b, :foreign_key => :name

My issue is that when I try to sort by column model_b.name will paginate does the correct sort but will not fire any query to count the total_entries.
In this way the total_entries returned is the size of the page.
I am not sure that the natural key is the culprit but any other relation that I include and sort works fine.

I am on rails 3.1.3 with sql_server.

Possibly an adapter issue?