Rails: How to list database tables/objects using the Rails console? -


i wondering if list/examine databases/objects available in rails console. know can see them using other tools, curious. thanks.

you seeking:

activerecord::base.connection.tables 

and

activerecord::base.connection.table_structure("projects") 

you should wrap them in shorter syntax inside .irbrc.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -