Forum: Ruby on Rails occassional NoMethodError after creating new model object

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C4fd1555c076437dffdfd33a14679246?d=identicon&s=25 Amir Javs (amirj26)
on 2009-03-05 18:50
(Received via mailing list)
This seems to happen every so often, where I have code similar to the
following:

new_model_obj = Foo.new
new_model_obj.someParam = someVar

And I get the following error:

<NoMethodError> undefined method `someParam=' for #<Foo >

This code normally runs fine with no problems, the Foo object clearly
has that attribute and this code works 95% of the time. The strange
thing I noticed is that in the error msg, #<Foo > does not have a hex
address location like it normally would. If I intentionally try to
create this error by calling new_model_obj.blah where I know blah is
not an attribute, I get an error msg that looks like this:

<NoMethodError> undefined method `blah' for #<Foo:0x476321c>

Anybody have any ideas why this would occasionally happen? Any help
would be greatly appreciated as I am thoroughly stumped.

Thanks
This topic is locked and can not be replied to.