Module: ActiveRecord::DatabaseUnsignedColumns::Definitions::Column

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_record/database_unsigned_columns/definitions/column.rb

Overview

Basado en thewebfellas.com/blog/2008/6/2/unsigned-integers-for-mysql-on-rails Modulo con extensiones/patches para ActiveRecord::ConnectionAdapters::ColumnDefinition.

Instance Method Summary collapse

Instance Method Details

#sql_type_with_unsignedObject

Override de #sql_type



18
19
20
21
22
23
24
25
# File 'lib/active_record/database_unsigned_columns/definitions/column.rb', line 18

def sql_type_with_unsigned
  # Cambio: signature de call base.type_to_sql:
  if base.method(:type_to_sql).parameters.include?([:opt, :unsigned])
    base.type_to_sql(type.to_sym, limit, precision, scale, unsigned) rescue type
  else
    base.type_to_sql(type.to_sym, limit, precision, scale) rescue type
  end
end