I have a process which iterates through a bunch of ActiveRecord models, does some processing, and saves the models again. Often though, the processing doesn\'t result in an
Actually the touch method is already in Rails 2.3.x, so you can simply do:
model.touch
To update the updated_at
column. Alternatively, to update some other column with the current date and time use:
model.touch(:column_name)
Now that the 2.3.x line has come and gone, a more definitive answer is that touch didn't make it into ActiveRecord until 2.3.8. So, anyone using still using Rails 2.3.2 (as the OP was -- and as I currently am) will need to find another way to "touch" their records.