Sha256: 9a1f4a424f3dd0d45cec45bd32f6ce72c0fb57632097399e3e397d9d129f6e88
Contents?: true
Size: 843 Bytes
Versions: 30
Compression:
Stored size: 843 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module CipherStashPG module OID # :nodoc: class DateTime < Type::DateTime # :nodoc: def cast_value(value) case value when "infinity" then ::Float::INFINITY when "-infinity" then -::Float::INFINITY when / BC$/ value = value.sub(/^\d+/) { |year| format("%04d", -year.to_i + 1) } super(value.delete_suffix!(" BC")) else super end end def type_cast_for_schema(value) case value when ::Float::INFINITY then "::Float::INFINITY" when -::Float::INFINITY then "-::Float::INFINITY" else super end end end end end end end
Version data entries
30 entries across 30 versions & 1 rubygems