I\'m encountering a problem with will_paginate while doing a complex find.
:photo has_many :tags, :through => :tagships
:item has_many :photos
:p
My first stab at this (sorry don't have time to test it right now... will update if I do) would be something like the following (added the :select and changed the :group):
@photos = @item.photos.paginate :page => params[:page],
:per_page => 200,
:select => "photos.*, COUNT(DISTINCT tags.id) AS tag_count",
:conditions => [ 'tags.id IN (?)', tag_ids ],
:order => 'created_at DESC',
:joins => :tags,
:group => "photos.id HAVING tag_count = #{tag_count}"