Re: Re: Re: Association In rails

Jean-Sébastien D.
Mon, 16 Jul 2012 15:43:46 -0000

Colin Law wrote in post #1068932:
> On 16 July 2012 16:31, Jean-Sbastien D.
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
>>>
>>> Colin
>>
>> I believe it is active_admin, but i am just wondering if the
Association
>> above seem to be correct, or i am totally missing the point of ruby on
>> rails association, like did i make mistake
>
> It looks ok to me.
>
> Colin

I come from mySQL where I would have 3 tables

Customer                TvShowManager                     TvShow
JOHN                    JEAN  tv_show_id(1)               1 Simpson
HEATHER                 JEAN  tv_show_id(2)               2 Familly Guy
JASON                   JASON tv_show_id(3)               3 Simpson
                        HEATHER tv_show_id(4)             4 Batman
                        HEATHER tv_show_id(5)             5 Stargate

Customer may have many tv_show_managers, and many tv_show through
tv_show_managers

Tv_show_Managers belongs_to customer
Tv_show_Managers belongs_to tv_show

Tv_show has_one tv_show_manager
Tv_show has_one customer, through tv_show_manager


Is it possible, or is dead wrong?