🕵️♀️ Task
The count method allows us to calculate the specific number of records that exist within an ActiveRecord::Relation.
LevelUp
0.0% complete
LevelUp
0.0% complete
| id | title | year | duration | description | image | director_id |
|---|
| id | name | dob | bio | image |
|---|
| id | name | dob | bio | image |
|---|---|---|---|---|
| 563 | George DiCenzo | 1940-04-21 | http://ia.media-imdb.com/im... | |
| 623 | Richard Ridings | 1958-09-19 | ||
| 624 | Nomi Sharron | |||
| 543 | James Mason | 1909-05-15 | James Mason was a great Eng... | http://ia.media-imdb.com/im... |
| 544 | Jessie Royce Landis | 1896-11-25 | Jessie Royce Landis was cal... | http://ia.media-imdb.com/im... |
| 545 | Leo G. Carroll | 1886-10-25 | One of the most indispensab... | http://ia.media-imdb.com/im... |
| 546 | Josephine Hutchinson | 1903-10-12 | As a child she studied at S... | |
| 547 | Philip Ober | 1902-03-23 | Philip Ober's bald head, st... | http://ia.media-imdb.com/im... |
| id | actor_id | movie_id | name |
|---|---|---|---|
| 561 | 503 | 39 | Frank |
| 562 | 504 | 39 | Capt. 'Ace' Owens |
| 563 | 505 | 39 | Burpelson AFB Defense Team ... |
| 564 | 506 | 40 | Dallas |
| 565 | 507 | 40 | Ripley |
| 566 | 508 | 40 | Lambert |
| 567 | 509 | 40 | Brett |
| 568 | 510 | 40 | Kane |
Count how many records are in the customers table.
Customer.all.count
=> 327
Count how many records are in the products table.
Product.all.count
=> 183946