File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
185
185
- [ Select A Select By Selector] ( rails/select-a-select-by-selector.md )
186
186
- [ Select Value For SQL Counts] ( rails/select-value-for-sql-counts.md )
187
187
- [ Show Pending Migrations] ( rails/show-pending-migrations.md )
188
+ - [ Show Rails Models With Pry] ( rails/show-rails-models-with-pry.md )
188
189
189
190
### ruby
190
191
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments