Hi Fred,

Thanks for your timely response.

> what makes you think they aren't there ?

I searched for them to no avail.  Shouldn't they be in the
Expense model (app\models\expense.rb); or
Expense controller (app\controllers\expenses_controller.rb?

I made a case-insensitive search for /vendor.nil\?/ in every
application file whose name matched /e?rb/i to no avail.

Could it be that adding relationships after the app & the database
have been created doesn't work?  Would I have better luck if I
scrapped everything and recreated the app with the relationships
defined? IMHO,  that would substantially limit the usefulness of
relationship macros.

Thanks again,
Richard

On Jul 16, 10:46 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> 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