method
cast_value
v6.0.0 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Date
cast_value(value)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/postgresql/oid/date.rb, line 8
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