🕵️♀️ 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 |
---|---|---|---|---|
325 | Dooley Wilson | 1886-04-03 | "You must remember this, a ... | http://ia.media-imdb.com/im... |
326 | Joy Page | 1924-11-09 | Actress Joy Page (nee Joy C... | http://ia.media-imdb.com/im... |
327 | John Qualen | 1899-12-08 | One of the best and most fa... | http://ia.media-imdb.com/im... |
328 | Leonid Kinskey | 1903-04-18 | Leonid Kinskey, originally ... | |
331 | Gabriel Byrne | 1950-05-12 | Byrne was the first of six ... | http://ia.media-imdb.com/im... |
332 | Benicio Del Toro | 1967-02-19 | Benicio Del Toro emerged in... | http://ia.media-imdb.com/im... |
333 | Kevin Pollak | 1957-10-30 | Born in San Francisco in 19... | http://ia.media-imdb.com/im... |
334 | Kevin Spacey | 1959-07-26 | As enigmatic as he is talen... | http://ia.media-imdb.com/im... |
id | actor_id | movie_id | name |
---|---|---|---|
328 | 291 | 23 | Clarice Starling |
329 | 292 | 23 | FBI Instructor |
330 | 293 | 23 | Ardelia Mapp |
331 | 294 | 23 | Agent Burroughs |
332 | 295 | 23 | Jack Crawford |
333 | 296 | 23 | Dr. Frederick Chilton |
334 | 297 | 23 | Barney |
335 | 298 | 23 | Friendly Psychopath |
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