Sha256: 8a2b6458442ecb22ddd5a0b901531194df47c09e5899dd371c414610dc2ce8b0
Contents?: true
Size: 608 Bytes
Versions: 69
Compression:
Stored size: 608 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module PostgreSQL module OID # :nodoc: class Date < Type::Date # :nodoc: def cast_value(value) case value when "infinity" then ::Float::INFINITY when "-infinity" then -::Float::INFINITY when / BC$/ astronomical_year = format("%04d", -value[/^\d+/].to_i + 1) super(value.sub(/ BC$/, "").sub(/^\d+/, astronomical_year)) else super end end end end end end end
Version data entries
69 entries across 69 versions & 6 rubygems