activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
# Cast a +value+ to a type that the database understands. For example,
# SQLite does not understand dates, so this method will convert a Date
# to a String.
Cast a +value+ to a type that the database understands. For example,
SQLite does not understand dates, so this method will convert a Date
to a String.
Cast a + value + to a type that the database understands . For example SQLite does not understand dates so this method will convert a Date to a String .
def type_cast(value, column = nil)
        if value.respond_to?(:quoted_id) && value.respond_to?(:id)
          return value.id
        end
        if column
          value = type_cast_from_column(column, value)
        end
        _type_cast(value)
      rescue TypeError
        to_type = column ? " to #{column.type}" : ""
        raise TypeError, "can't cast #{value.class}#{to_type}"
      end
def type_cast ( value , column = nil ) if value . respond_to? ( :quoted_id ) && value . respond_to? ( :id ) return value . id end if column value = type_cast_from_column ( column , value ) end _type_cast ( value ) rescue TypeError to_type = column ? " to #{column.type}" : "" raise TypeError , "can't cast #{value.class}#{to_type}" end
Cast a +value+ to a type that the database understands.
Cast a + value + to a type that the database understands .
value
<not_specific>
column
<not_specific>