Overriding Rails' automatic timestamps: updated_at & created_at

When converting something in a project, I found that I needed to updated a field for every record in a Request table. No problem, except this client grabs a SQL dump and run reports on it. So, Rails' automatic timestamping of the updated_at field made all of the Requests look like they'd just been updated. Which they had, but not by users. So, this rake task will reset all of them, presuming you have something to set them to. In my case, I found the latest comment date and used that, but you could figure it out some other way.

Established 2005 · Databasically © 2016