Steve Castaneda wrote:
> Jamey Cribbs wrote:
>> Sounds like you do not have your associations defined correctly in your 
>> model.
>> 
>> In your Buyer model you should have this line:
>> 
>>     belongs_to :status
>> 
>> In your Status model you should have this line:
>> 
>>     has_many :buyers
>> 
>> 
>> HTH,
>> 
>> Jamey
> 
> That was it!  Thank you so much.  I was totally getting confused here:
> 
> belongs_to :status vs. has_one :status
> 
> Can you help me understand why it's belongs_to and not has_one?  A 
> status is part of a buyer, so I guess I just get confused on the logic.

has_one is just like has_many except for different cardinality: it means 
that this table doesn't contain the foreign key.

If you had read the docs for the Associations module, you would have 
seen this very point clearly explained.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to