method
convert_time_to_time_zone
v8.1.1 -
Show latest stable
- Class:
ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter
convert_time_to_time_zone(value)private
No documentation available.
# File activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb, line 44
def convert_time_to_time_zone(value)
return if value.nil?
if value.acts_like?(:time)
converted = value.in_time_zone
if type == :time && converted
converted = converted.change(year: 2000, month: 1, day: 1)
end
converted
elsif value.respond_to?(:infinite?) && value.infinite?
value
else
map(value) { |v| convert_time_to_time_zone(v) }
end
end