edge badge
Methods
C
Included Modules
Instance Public methods
cast_value(value)
# File activerecord/lib/active_record/connection_adapters/postgresql/oid/date_time.rb, line 8
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 + 1)
      super(value.sub(/ BC$/, "").sub(/^\d+/, astronomical_year))
    else
      super
    end
  else
    value
  end
end