Sha256: 47e6551382ac62b7836867886f2f3f55462a4aee0eeb3e05e88c1c2d4fe7f40d
Contents?: true
Size: 616 Bytes
Versions: 60
Compression:
Stored size: 616 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module PostgreSQL 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$/ 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
60 entries across 60 versions & 7 rubygems