Update update_at time without changing anything

Is it possible to touch the model, causing the field updated_atto be updated to the current time without actually changing anything in other fields?

+4
source share
1 answer

you can use touch

model.touch

or

model.touch(:updated_at) #or anyother timestamp attribute

Documentation here

+11
source

All Articles