Class: RailsLens::ERD::MysqlColumnTypeFormatter

Inherits:
ColumnTypeFormatter show all
Defined in:
lib/rails_lens/erd/mysql_column_type_formatter.rb

Instance Method Summary collapse

Methods inherited from ColumnTypeFormatter

format, #initialize

Constructor Details

This class inherits a constructor from RailsLens::ERD::ColumnTypeFormatter

Instance Method Details

#formatObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rails_lens/erd/mysql_column_type_formatter.rb', line 6

def format
  case @column.sql_type
  when /json/i then 'json'
  when /enum/i then 'enum'
  when /set/i then 'set'
  when /mediumtext/i then 'mediumtext'
  when /tinyint\(1\)/i then 'boolean'
  else
    super
  end
end