class ActiveRecord::ConnectionAdapters::PostgreSQL::OID::TimestampWithTimeZone

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/active_record/connection_adapters/postgresql/oid/timestamp_with_time_zone.rbs

class ActiveRecord::ConnectionAdapters::PostgreSQL::OID::TimestampWithTimeZone < ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime
  def cast_value: (Time value) -> Time
end

:nodoc:
:nodoc:

def cast_value(value)

Experimental RBS support (using type sampling data from the type_fusion project).

def cast_value: (Time value) -> Time

This signature was generated using 1 sample from 1 application.

def cast_value(value)
  return if value.blank?
  time = super
  return time if time.is_a?(ActiveSupport::TimeWithZone) || !time.acts_like?(:time)
  # While in UTC mode, the PG gem may not return times back in "UTC" even if they were provided to Postgres in UTC.
  # We prefer times always in UTC, so here we convert back.
  if is_utc?
    time.getutc
  else
    time.getlocal
  end
end

def type

:nodoc:
:nodoc:
def type
  real_type_unless_aliased(:timestamptz)
end