method
touch
rails latest stable - Class:
ActiveRecord::Timestamp
touch(attribute = nil)public
Saves the record with the updated_at/on attributes set to the current time. If the save fails because of validation errors, an ActiveRecord::RecordInvalid exception is raised. If an attribute name is passed, that attribute is used for the touch instead of the updated_at/on attributes.
Examples:
product.touch # updates updated_at product.touch(:designed_at) # updates the designed_at attribute
1Note
Validations
out of the box touch will run with validations