Before moving forward, we need to understand what touch method is. touch is used to
update updated_at timestamp by default to current time. It also takes custom time or different columns as parameters.
Rails 6 has added touch_all on ActiveRecord::Relation
to touch multiple records in a go. Before Rails 6, we needed to iterate on all records using an iterator to achieve this.
Let’s take an example in which we call touch_all on all User records.
touch_all returns count of the records on which it is called.
touch_all also takes a custom time or different columns as parameters.