# Updated\_on broken

**URL:** <https://www.ruby-forum.com/t/updated-on-broken/149439>\
**Category:** Rails\
**Created:** [September 24, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/updated-on-broken/149439 "2008-09-24T22:27:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [September 24, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/updated-on-broken/149439/1 "2008-09-24T22:27:32Z")

</div>

Hi,

I just noticed that updated\_on is not working anymore on any of my  
models. I don’t know what happened ☹ . Hower, when I create a new  
record, created\_on is still working.

Any ideas what could be the cause?

Greetz

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [September 24, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/updated-on-broken/149439/2 "2008-09-24T23:37:51Z")

</div>

Quoting Maarten P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hi,
> 
> I just noticed that updated\_on is not working anymore on any of my  
> models. I don’t know what happened ☹ . Hower, when I create a new  
> record, created\_on is still working.
> 
> Any ideas what could be the cause?

Did you just update to Rails 2.1? Only changed attributes are written  
on  
save. If no attributes are changed, then nothing is written to the  
database,  
not even updated\_on/updated\_at. Of course, setting updated\_at =  
Time.now will  
force a change (not sure what the equivalent is for updated\_on).

HTH,  
Jeffrey

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [September 25, 2008, 11:35am UTC](https://www.ruby-forum.com/t/updated-on-broken/149439/3 "2008-09-25T11:35:16Z")

</div>

Hey Jeffrey,

I did indeed update to rails 2.1 recently … It really makes sense  
because I was probably updating associated models. Forcing updated\_on =  
Time.now fixed the problem.

Thanks Jeffrey
