Re: Re: Re: Re: Re: Association In rails

Jean-Sébastien D.
Mon, 16 Jul 2012 16:18:01 -0000

Colin Law wrote in post #1068942:
> On 16 July 2012 17:01, Jean-Sbastien D.
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
>>
>> # database schema. If you need to create the application database on
>>
>>     t.string   "security_answer"
>>   end
>>     t.integer  "customer_id"
>>     t.datetime "created_at",  :null => false
>>     t.datetime "created_at",          :null => false
>>
>> But i think its looks good, should i also reinforce in my model foreign
>> key so it doesnt get confused
>
> It looks ok to me.  Not sure what you mean by reinforcing the foreign
> key.
>
> Colin

In the model tv_show_manager

Tv_show_Managers belongs_to customer, foreign_key: "customer_id"
Tv_show_Managers belongs_to tv_show, foreign_key: "tv_show_id"


Is it helpfull for ruby to understand exactly which field is which or
its just a waste?