Jordan Schwartz Jordan Schwartz - 2 years ago 72
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.

Answer Source

You could use .update_all:

User.where(:id => => true)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download