Today I Learned

hashrocket A Hashrocket project

Show Rails Models With Pry

With the pry-rails gem, you get some extra goodies in the Rails console for your project. One of those goodies is show-models, a command for printing out a list of all models in the rails project. Add and bundle the pry-rails gem, run rails c, and then run show-models to give it a go.

> show-models
Pokemon
  id: integer
  name: string
  level: integer
  pokemon_type: varchar
  belongs_to Trainer
  created_at: datetime
  updated_at: datetime
Trainer
  id: integer
  name: string
  has_many Pokemons
See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.