I know that you can ask ActiveRecord to list tables in console using:
ActiveRecord::Base.connection.tables
Is there a command that would li
For a more compact format, and less typing just:
Portfolio.column_types
To list the columns in a table I usually go with this:
Model.column_names.sort
.
i.e. Orders.column_names.sort
Sorting the column names makes it easy to find what you are looking for.
For more information on each of the columns use this:
Model.columns.map{|column| [column.name, column.sql_type]}.to_h
.
This will provide a nice hash. for example:
{
id => int(4),
created_at => datetime
}