Displaying 2 results from an estimated 2 matches for "actors_movi".
Did you mean:
actors_movies
2006 Aug 16
3
Question RE Rails associations
...ctor < 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 related movies? Or, stated differently, how do I find all
movies for a given studio/actor combination?...
2006 Jan 21
7
n-way joins
Hi,
I''m somewhat of a Rails newbie and am trying to understand how to
formulate n-way (3 or 4 way) joins in Rails (where the join tables
contain extra data as well.)
Let me give you my basic entities:
foos
id - pk
name - unique
bars
id - pk
name - unique
bazs
id - pk
name - unique
frozs
id - pk
name - unique
then i have two separate join tables:
foos_bars_bazs - 3 way join