Method: DatabaseDocumenter::Exporters::ExportToWord#generate_table_metadata

Defined in:
lib/database_documenter/exporters/export_to_word.rb

#generate_table_metadata(docx, klass) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/database_documenter/exporters/export_to_word.rb', line 47

def (docx, klass)
   = table_data.(klass)
  docx.p ''
  docx.h2 klass.table_name.to_s
  docx.hr

  word_table = [
    ["Table Name", [:name]],
    ["Description", [:description]],
    ["Primary Key", [:primary_key]],
    ["SQL Code", [:sql_code]]
  ]

  docx.table word_table, border_size: 4 do
    cell_style rows[0][0], background: 'b4b4b4', bold: true, width: 2000
    cell_style rows[1][0], background: 'e0e0e0', bold: true, width: 2000
    cell_style rows[2][0], background: 'e0e0e0', bold: true, width: 2000
    cell_style rows[3][0], background: 'e0e0e0', bold: true, width: 2000
  end
end