Hi Bill,

I didn't notice your response a while ago.  I did try out all three
"method" displays.  They all returned a slew of methods, even the most
restrictive one, private_methods.

One of the strangest results to me is:
>> expense = Expense.find(:first)
=> #<Expense id: 1, vendor: "Z01-2010.06.26 (Z01-Test)", description:
"Added new vendor", [snip]
>> expense.vendor
=> nil

Clearly the vendor attribute of the first expense record in not nil,
as expense.vendor reports
BTW, the vendor attribute represents the (artificial vendor name)
rather than a vendor id because I've got another problem, which I
reported in one of the other posts on this thread.

Thanks for weighing in here about my problem.  Things are looking up.

Best wishes,
Richard


On Jul 16, 11:06 am, Bill Walton <bwalton...@gmail.com> wrote:
> Hi Richard,
>
> On Fri, Jul 16, 2010 at 9:32 AM, RichardOnRails wrote:>
> >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?
> > 2.  What do I have to do to get them generated? (I can't find any such
> > methods defined anywhere.)
>
> In the Rails console, try these:
>
> Expense.methods
> Expense.public_methods
> Expense.private_methods
>
> One of the things that takes some getting used to with Rails is how
> much it does a lot for you behind the scenes.
>
> HTH,
> Bill

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