Flowdock
method

cast_value

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: DateTime
cast_value(value) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/postgresql/oid/date_time.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
Register or log in to add new notes.