Sha256: ba48cf6323a33970163177ed3fefcbb7bf11290b266b8fcd3c3b5d916122da8c
Contents?: true
Size: 781 Bytes
Versions: 32
Compression:
Stored size: 781 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module CipherStashPG module OID # :nodoc: class TimestampWithTimeZone < DateTime # :nodoc: def type real_type_unless_aliased(:timestamptz) end def cast_value(value) return if value.blank? time = super return time unless 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 end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems