Active record help - sorting by number of paintings

An artist has many paintings.

I am having trouble doing this. How can I make Active Record retrieve
and sort all artists based on the number of paintings. The record
should also show the number of paintings of each artist.

By the way, I am using PgSql.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs