instance method
touch_attributes_with_time
Ruby on Rails 5.1.7
Since v5.1.7 Last seen in v5.1.7Signature
touch_attributes_with_time(*names, time: nil)
No documentation comment.
Parameters
-
namesrest -
timekey = nil
Source
# File activerecord/lib/active_record/timestamp.rb, line 56
def touch_attributes_with_time(*names, time: nil)
attribute_names = timestamp_attributes_for_update_in_model
attribute_names |= names.map(&:to_s)
time ||= current_time_from_proper_timezone
attribute_names.each_with_object({}) { |attr_name, result| result[attr_name] = time }
end
Defined in activerecord/lib/active_record/timestamp.rb line 56
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Timestamp