Revision: 1367
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 29, 2006 01:22 by rduv
Initial Code
def self.find_with_all_actors(*actors) return [] if actors.empty? actors = actors.flatten find(:all, :readonly => false, :joins => "INNER JOIN appearances a ON movies.id = a.movie_id", :conditions => "a.actor_id IN (#{actors.map(&:id).join(', ')})", :group => "movies.id HAVING COUNT(movies.id) = #{actors.size}") end
Initial URL
Initial Description
Initial Title
associations are not enough
Initial Tags
Initial Language
Ruby