🕵️♀️ 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 |
---|---|---|---|---|
88 | E.G. Marshall | 1914-06-18 | With over 150 Film and TV a... | http://ia.media-imdb.com/im... |
89 | Jack Klugman | 1922-04-27 | As a film character actor, ... | http://ia.media-imdb.com/im... |
90 | Edward Binns | 1916-09-12 | Gravel-voiced, authoritativ... | http://ia.media-imdb.com/im... |
91 | Jack Warden | 1920-09-18 | Jack Warden was born John H... | http://ia.media-imdb.com/im... |
95 | George Voskovec | 1905-06-19 | Founded Czech avantgarde th... | http://ia.media-imdb.com/im... |
316 | Humphrey Bogart | 1899-12-25 | The son of a moderately wea... | http://ia.media-imdb.com/im... |
317 | Ingrid Bergman | 1915-08-29 | Ingrid Bergman was born in ... | http://ia.media-imdb.com/im... |
96 | Robert Webber | 1924-10-14 | Over his 40-year career as ... | http://ia.media-imdb.com/im... |
id | actor_id | movie_id | name |
---|---|---|---|
97 | 91 | 7 | Juror #7 |
98 | 92 | 7 | Juror #8 |
99 | 93 | 7 | Juror #9 |
100 | 94 | 7 | Juror #10 |
101 | 95 | 7 | Juror #11 |
102 | 96 | 7 | Juror #12 |
103 | 97 | 8 | Oskar Schindler |
104 | 98 | 8 | Itzhak Stern |
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