Module: ActiveRecord::Timestamp::ClassMethods

Defined in:
lib/active_record/timestamp.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#touch_attributes_with_time(*names, time: nil) ⇒ Object



56
57
58
59
60
61
# File '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