Sha256: 412a9c9f3adbd1f6baa2fc2bf89ba1d1dcb27256bdead391c39b08017b7af30c
Contents?: true
Size: 610 Bytes
Versions: 11
Compression:
Stored size: 610 Bytes
Contents
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime.class_eval do def cast_value(value) if value.is_a?(::String) case value when 'infinity' then ::Float::INFINITY when '-infinity' then -::Float::INFINITY #when / BC$/ # astronomical_year = format("%04d", value[/^\d+/].to_i) # super(value.sub(/ BC$/, "").sub(/^\d+/, astronomical_year)) else if value.end_with?(' BC') DateTime.parse("-#{value}"[0...-3]) else super end end else value end end end
Version data entries
11 entries across 11 versions & 3 rubygems