Export database tables, fields comments as markup with Ruby on Rails

When you have to export the comments from the database you can use this short snippet to get the schema as markup.

The output should be something like

Table name

table description

column name, type, description

….. the next table