Re: [Rails] Re: One to many ralationships

2011-01-28 Thread Conrad Taylor
Hi, in tour relationship below, you simply need has_one or belongs_to but not both. It really depends where you would like the foreign key. For example, if you use has_one, then the foreign key, job_id, will be in the workers table. If you use the belongs_to, the foreign key, worker_id, shou

Re: [Rails] Re: One to many ralationships

2011-01-28 Thread Conrad Taylor
Sent from my iPhone On Jan 28, 2011, at 7:27 PM, Me wrote: > Nope. > > class Worker < AR > has_one :job > end > > -- > class Job < AR > belongs_to :worker > end > > worker_id in this table > - > -- > You received this message because you are sub

[Rails] Re: One to many ralationships

2011-01-28 Thread Me
Nope. class Worker < AR has_one :job end -- class Job < AR belongs_to :worker end worker_id in this table - -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email