Flowdock
method

type_cast

Importance_0
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: ActiveRecord::ConnectionAdapters::SQLiteAdapter

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

These similar methods exist in v4.0.2:

type_cast(value, column) 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/sqlite_adapter.rb, line 200
        def type_cast(value, column) # :nodoc:
          return value.to_f if BigDecimal === value
          return super unless String === value
          return super unless column && value

          value = super
          if column.type == :string && value.encoding == Encoding::ASCII_8BIT
            logger.error "Binary data inserted for `string` type on column `#{column.name}`" if logger
            value = value.encode Encoding::UTF_8
          end
          value
        end
Register or log in to add new notes.