Jordan Schwartz Jordan Schwartz - 10 months ago 30
Ruby Question

Update attribute without altering the updated_at field

I'm running rails 3.0. I have a object I want to change a boolean field on but do not want to change the updated_at timestamp. We won't be upgrading rails any time soon, so update_column is out of the question. I'd rather not make model-level changes to support this (like in this post:, since many of objects of this type may have methods called on them at the same time.


You could use .update_all:

User.where(:id => => true)