I have tried to use eager association with pagination, but
the :include option is not supported:
Here''s the one-line pagination call without :include
@link_pages, @links = paginate :link, :per_page => 10, :order_by
=> sort_clause
and here the work around, using the "classic" method
# @link_pages = Paginator.new self, Link.count, 10,
@params[''page'']
# @links = Link.find_all nil, sort_clause, @link_pages.current.to_sql
# limit = @link_pages.current.to_sql.first
# offset = @link_pages.current.to_sql.last
# @links = Link.find( :all, :order => sort_clause, :limit =>
limit, :offset => offset,
# :include => [:linktype_remote] )
Is there a reason for not allowing :include in the pagination? or an
oversight? Time to write a patch?
Jens-Christian
--
InVisible GmbH, Langgrütstrasse 172, 8047 Zürich
Phone: +41 44 401 09 30
http://www.invisible.ch http://not.invisible.ch