Skip to content

Commit b3384ee

Browse files
committed
Add Show Rails Models With Pry as a rails til.
1 parent 1b4941f commit b3384ee

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
185185
- [Select A Select By Selector](rails/select-a-select-by-selector.md)
186186
- [Select Value For SQL Counts](rails/select-value-for-sql-counts.md)
187187
- [Show Pending Migrations](rails/show-pending-migrations.md)
188+
- [Show Rails Models With Pry](rails/show-rails-models-with-pry.md)
188189

189190
### ruby
190191

rails/show-rails-models-with-pry.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Show Rails Models With Pry
2+
3+
With the [`pry-rails`](https://github.com/rweng/pry-rails) gem, you get some
4+
extra goodies in the Rails console for your project. One of those goodies is
5+
`show-models`, a command for printing out a list of all models in the rails
6+
project. Add and bundle the `pry-rails` gem, run `rails c`, and then run
7+
`show-models` to give it a go.
8+
9+
```
10+
> show-models
11+
Pokemon
12+
id: integer
13+
name: string
14+
level: integer
15+
pokemon_type: varchar
16+
belongs_to Trainer
17+
created_at: datetime
18+
updated_at: datetime
19+
Trainer
20+
id: integer
21+
name: string
22+
has_many Pokemons
23+
```

0 commit comments

Comments
 (0)