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

Colin Law
Mon, 16 Jul 2012 16:28:26 -0000

On 16 July 2012 17:18, Jean-Sébastien D.
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:
> 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?

It is not required, it makes no difference to Rails, since it already
the default, but may confuse a reader as he/she will wonder why it is
there.

I suspect your problem is something to do with the way you are using activeadmin

Colin

>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en-US.
>

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.