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
--
View this message in context:
http://www.nabble.com/paginating_find-Use-of-Calculations%3A%3Acount-problem-tf2249227.html#a6238265
Sent from the RubyOnRails Users forum at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---