Suppressing updated_at from being updated

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.
[email protected]

Blog: http://www.kopanas.com
Conference: http://www.cusec.net
Twits: http://www.twitter.com/kopanas

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…

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs