Flowdock
method

type_cast

Importance_0
v3.2.8 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::SQLiteAdapter
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.encode! 'utf-8'
          end
          value
        end
Register or log in to add new notes.