On Jul 16, 3:32 pm, RichardOnRails
<richarddummymailbox58...@uscomputergurus.com> wrote:
> Hi,
>
> I've got a Rails app working that includes two two classes, etc.:
> Expense & Vendor.  I eventually learned that the mental concept I had
> of their relationship should be express in Rails as:
>
> class Expense < ActiveRecord::Base;   belongs_to :vendor; end
> class Vendor < ActiveRecord::Base;   has_many :expenses; end
>
> http://rails.rubyonrails.org/classes/ActiveRecord/Associations/ClassM...
> informs me that the following methods will be generated in Expense:
>
> vendor
> vendor=
> vendor.nil
>
> 1.  Are my expectations correct?

yes (and there are some other methods too)
> 2.  What do I have to do to get them generated? (I can't find any such
> methods defined anywhere.)
what makes you think they aren't there ?

Fred

-- 
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