def build
      results = [%w[Field Type Null Default]]
      @klass.columns_hash.each do |name, column|
        default = case column.default
        when NilClass then ''
        when TrueClass then '1'
        when FalseClass then '0'
        else column.default
        end
        results << [name, column.sql_type, column.null ? 'YES' : 'NO', default]
      end
      lengths = results.transpose.map { |list| list.max_by { |segment| segment.to_s.length }.length + 1 }
      
      definition = results.map do |line|
        '# ' + line.map.with_index { |segment, index| "| %-#{lengths[index]}s" % segment }.join + "|\n"
      end
      header_line = '# ' + lengths.map { |length| '+' + '-' * (length + 1) }.join + "+\n"
      [header_line, definition.first, header_line] + definition[1..-1] + [header_line]
    end
def build
      results = [%w[Field Type Null Default]]
      @klass.columns_hash.each do |name, column|
        default = case column.default
        when NilClass then ''
        when TrueClass then '1'
        when FalseClass then '0'
        else column.default
        end
        results << [name, column.sql_type, column.null ? 'YES' : 'NO', default]
      end
      lengths = results.transpose.map { |list| list.max_by { |segment| segment.to_s.length }.length + 1 }
      
      definition = results.map do |line|
        '# ' + line.map.with_index { |segment, index| "| %-#{lengths[index]}s" % segment }.join + "|\n"
      end
      header_line = '# ' + lengths.map { |length| '+' + '-' * (length + 1) }.join + "+\n"
      [header_line, definition.first, header_line] + definition[1..-1] + [header_line]
    end
takes a descendant of ActiveRecord::Base
 builds the lines to be put into the top of the file