# Undefined method updated? for \<model object\>

**URL:** <https://www.ruby-forum.com/t/undefined-method-updated-for-model-object/173006>\
**Category:** Rails\
**Created:** [July 31, 2009, 8:44am UTC](https://www.ruby-forum.com/t/undefined-method-updated-for-model-object/173006 "2009-07-31T08:44:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himanshu\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@Himanshu\_P](https://www.ruby-forum.com/u/Himanshu_P)\
**Post date:** [July 31, 2009, 8:44am UTC](https://www.ruby-forum.com/t/undefined-method-updated-for-model-object/173006/1 "2009-07-31T08:44:05Z")

</div>

Hi,  
I have two model say-

ZipCode \< ActiveRecord::Base  
belongs\_to :state\_provinces  
end

StateProvince \< ActiveRecord::Base  
has\_many :zip\_codes  
end

if I do @zip\_code.update\_atribute(:city, “My City”)  
its giving Undefined method updated? for StateProvince

if I remove belongs\_to specifier in ZipCode class then it work fine.  
Any alternate solution??

## Thanks

Regards,  
Himanshu

---

<div class="post-metadata">

**Author:** ![Himanshu\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@Himanshu\_P](https://www.ruby-forum.com/u/Himanshu_P)\
**Post date:** [August 1, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/undefined-method-updated-for-model-object/173006/2 "2009-08-01T18:32:50Z")

</div>

Could you provide the error trace?

Cheers,  
Nicholas

---

<div class="post-metadata">

**Author:** ![Himanshu\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@Himanshu\_P](https://www.ruby-forum.com/u/Himanshu_P)\
**Post date:** [August 2, 2009, 8:20am UTC](https://www.ruby-forum.com/t/undefined-method-updated-for-model-object/173006/3 "2009-08-02T08:20:55Z")

</div>

Himanshu P. wrote:

> Hi,  
> I have two model say-
> 
> ZipCode \< ActiveRecord::Base  
> belongs\_to :state\_provinces  
> end

I don’t know if this is related to the error you’re having, but  
belongs\_to takes a _singular_ model name, so that should be

belongs\_to :state\_province

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
