# Suppressing updated\_at from being updated

**URL:** <https://www.ruby-forum.com/t/suppressing-updated-at-from-being-updated/123983>\
**Category:** Rails\
**Created:** [December 23, 2007, 1:48am UTC](https://www.ruby-forum.com/t/suppressing-updated-at-from-being-updated/123983 "2007-12-23T01:48:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [December 23, 2007, 1:48am UTC](https://www.ruby-forum.com/t/suppressing-updated-at-from-being-updated/123983/1 "2007-12-23T01:48:36Z")

</div>

This seems like blasphemy but their is a situation where I do not want  
updated\_at to be updated on update… I know I know… but is their a  
way?

–  
John K.  
removed\_email\_address@domain.invalid

Blog: [http://www.kopanas.com](http://www.kopanas.com)  
Conference: [http://www.cusec.net](http://www.cusec.net)  
Twits: [http://www.twitter.com/kopanas](http://www.twitter.com/kopanas)

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [December 23, 2007, 2:07am UTC](https://www.ruby-forum.com/t/suppressing-updated-at-from-being-updated/123983/2 "2007-12-23T02:07:53Z")

</div>

Don’t know if this will work, but try making a before\_update filter  
that finds the original object with the original updated\_at and set  
the object to that value…

something like

def before\_update  
original\_record = Model.find(self.id)  
self.updated\_at = original\_record.updated\_at  
end

Again, I don’t know if this is going to work. I’m guessing that the  
updated\_at is set by Rails after your before\_update filter…

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [December 23, 2007, 2:19am UTC](https://www.ruby-forum.com/t/suppressing-updated-at-from-being-updated/123983/3 "2007-12-23T02:19:00Z")

</div>

On 23 Dec 2007, at 00:47, John K. wrote:

> This seems like blasphemy but their is a situation where I do not  
> want updated\_at to be updated on update… I know I know… but is  
> their a way?

You want to fiddle with ActiveRecord::Base.record\_timestamps

Fred
