# Occassional NoMethodError after creating new model object

**URL:** <https://www.ruby-forum.com/t/occassional-nomethoderror-after-creating-new-model-object/162102>\
**Category:** Rails\
**Created:** [March 5, 2009, 6:50pm UTC](https://www.ruby-forum.com/t/occassional-nomethoderror-after-creating-new-model-object/162102 "2009-03-05T18:50:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirj26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@amirj26](https://www.ruby-forum.com/u/amirj26)\
**Post date:** [March 5, 2009, 6:50pm UTC](https://www.ruby-forum.com/t/occassional-nomethoderror-after-creating-new-model-object/162102/1 "2009-03-05T18:50:49Z")

</div>

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:

undefined method `someParam=’ for #

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, # 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:

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
