Re: Question RE Rails associations

Couldn’t you do Movie.find_by_actor_and_studio?

end

class Actor < ActiveRecord::Base
has_and_belongs_to_many :studios
has_and_belongs_to_many :movies
end

snip

The question I want to answer is, given an actor_id
and studio_id,
how
do I find all related movies? Or, stated
differently, how do I find
all
movies for a given studio/actor combination?


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs