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



309
310
311
312
313
314
315
# File 'lib/active_record/connection_adapters/mysql_adapter.rb', line 309

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