try using :joins instead of :include
@callerid_pages, @callerids = paginate :caller_ids, :conditions =>
["ci.geotag_id = gt.id <http://gt.id> and gt.firm_id = ?" ,
firm_id],
:order_by => "gt.address1 ASC" , :joins => "as ci, geotags
as gt", :per_page
=> 10
On 11/17/05, Brutyn nick
<brutyn_nick-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
wrote:>
> hey, i want a list of callers, 10 per page, depending on which firm id (in
> table
> geotags)
>
> @callerid_pages, @callerids = paginate :caller_ids, :conditions =>
> ["caller_ids.geotag_id = geotags.id <http://geotags.id> and
> geotags.firm_id = ?" , firm_id],
> :order_by => "geotags.address1 ASC" , :include=>[:geotag],
:per_page => 10
>
> and i get this error
>
> #42S02Unknown table ''geotags'' in where clause: SELECT
COUNT(*) FROM
> caller_ids
> WHERE (caller_ids.geotag_id = geotags.id <http://geotags.id> and
> geotags.firm_id = 1)
>
> thanks
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails