method
cast_value
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime
cast_value(value)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/postgresql/oid/date_time.rb, line 6
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