Ruby on Rails Friday, May 13, 2016

On 13 May 2016 at 07:10, Colin Law <clanlaw@gmail.com> wrote:
>
> On 12 May 2016 11:44 p.m., "Luis" <luismcdougall@gmail.com> wrote:
>>
>> Ok there is something that I am not getting in here I think this should
>> work. What am I missing ?
>>
>> class Sched < ActiveRecord::Base
>> belongs_to :admiting_md, :foreign_key => :admiting_md ,:class_name =>
>> "Pcp"
>> end
>>
>> class Pcp < ActiveRecord::Base
>> has_many :admiting_mds, :foreing_key => :admiting_md, :class_name =>
>> "Sched"
>
> You have still misspelt foreign.

Also the convention would be to call the key admiting_md_id

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvSBitETpPjC4ty19t0yT2p22FNfgUY0D988FeNFJsxkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment