On Jan 14, 3:39 pm, Jim Burgess <li...@ruby-forum.com> wrote:

> Could anyone tell me why the first example produces a NoMethodError and
> the second one works just fine?
>
because read/write_attribute are instance methods, but you're trying
to call them on Product (ie a class). self.read_attribute (or just
read_attribute) should work fine

Fred


> Thanks very much.
>
> --
> Posted viahttp://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-talk@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