Spec-Zone.ru › Ruby on Rails 4.1

модуль ActiveRecord::ConnectionAdapters::MysqlAdapter::Fields

Константы

TYPES

Общедоступные методы класса

alias_type(new, old) Показать исходный код
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 388
def self.alias_type(new, old)
  TYPES[new] = TYPES[old]
end
find_type(field) Показать исходный код
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 392
def self.find_type(field)
  if field.type == Mysql::Field::TYPE_TINY && field.length > 1
    TYPES[Mysql::Field::TYPE_LONG]
  else
    TYPES.fetch(field.type) { Fields::Identity.new }
  end
end
register_type(type_id, type) Показать исходный код

Регистрация MySQL type_id с объектом преобразования типов в type.

# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 384
def self.register_type(type_id, type)
  TYPES[type_id] = type
end

© 2004–2016 David Heinemeier Hansson
Licensed under the MIT License.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API