class ActiveRecord::ConnectionAdapters::Mysql2Adapter

Public Instance Methods

native_database_types() click to toggle source
# File lib/active_record/connection_adapters/mysql2.rb, line 6
def native_database_types
  self.class::NATIVE_DATABASE_TYPES.merge(enum: {name: "enum"})
end
type_to_sql(type, limit: nil, precision: nil, scale: nil, unsigned: nil, **)
Also aliased as: type_to_sql_without_enum
type_to_sql_with_enum(type, limit: nil, precision: nil, scale: nil, unsigned: nil, **) click to toggle source
# File lib/active_record/connection_adapters/mysql2.rb, line 10
def type_to_sql_with_enum(type, limit: nil, precision: nil, scale: nil, unsigned: nil, **)
  if type.to_sym == :enum
    "#{type}(#{limit.map{|n| "'#{n}'"}.join(",")})"
  else
    type_to_sql_without_enum(type, limit: limit, precision: precision, scale: scale, unsigned: unsigned)
  end
end
Also aliased as: type_to_sql
type_to_sql_without_enum(type, limit: nil, precision: nil, scale: nil, unsigned: nil, **)
Alias for: type_to_sql