Table : contacts, customers
contact belongs_to :customer
When using the following paginate :
@contact_pages, @contacts = paginate :contact, :conditions =>'contacts.name like "b%" and customers.name like "k%"' ,:include=>:customer,:per_page => 20, :order=>sort_clause
the :include is only used in fetching the data
the count fails : Unknown table 'customers' in where clause: SELECT COUNT(*) FROM contacts WHERE (contacts.name like 'b%' and customers.name like 'k%')
But the documentation claims : :include: optional eager loading parameter passed to Model.find(:all, *params) and Model.count