Displaying 1 result from an estimated 1 matches for "studio_id".
2006 Aug 16
3
Question RE Rails associations
...Movie < ActiveRecord::Base
belongs_to :studio
has_and_belongs_to_many :actors
end
class Actor < ActiveRecord::Base
has_and_belongs_to_many :studios
has_and_belongs_to_many :movies
end
The underlying database structure is as follows:
studios
id: integer
movies
id: integer
studio_id: integer
actors
id: integer
actors_studios
actor_id: integer
studio_id: integer
actors_movies
actor_id: integer
movie_id: integer
(Note that in this case I am not using a movies_studios table)
The question I want to answer is, given an actor_id and studio_id, how
do I find all rel...