I have a multi-table join that pencils out as follows:
Member.find(:all, :include => :contacts, :conditions => ['(members.projects LIKE ?) AND (contacts.updated_by = ?)', '%my project%', 'System Administrator'])
This finds all projects like 'my project' ever updated by 'system administrator' (member has_many :contacts).
I installed paginating_find, and it works wonderfully for a straight pagination, but with the above code, when I add in:
:page => {:current => 1}
the count method (used to figure out how many pages there will be) doesn't find the 'contacts' table. The SQL generated is:
SELECT count(*) AS count_all FROM members WHERE ((members.projects LIKE '%my project%') AND (contacts.updated_by = 'System Administrator'))
Does anyone know why ActiveRecord::Calculations is ignoring the :include option or have a workaround?
Thanks