Module: ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields

Defined in:
lib/active_record/connection_adapters/mysql_adapter.rb

Overview

:nodoc:

Defined Under Namespace

Classes: DateTime, Time

Constant Summary collapse

TYPES =

:nodoc:

Type::HashLookupTypeMap.new

Class Method Summary collapse

Class Method Details

.find_type(field) ⇒ Object



313
314
315
316
317
318
319
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 313

def find_type(field)
  if field.type == Mysql::Field::TYPE_TINY && field.length > 1
    TYPES.lookup(Mysql::Field::TYPE_LONG)
  else
    TYPES.lookup(field.type)
  end
end