Artist.first.medias returns all medias. Media is an STI. Media can be video or painting.
How do I return all paintings of an artist? Only paintings, not videos?
In my Artist model, I tried putting:
has_many :paintings, :through => :medias
In console, I do:
Artist.first.paintings.all
And I get:
ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :painting or :paintings in model Media. Try 'has_many :paintings, :through => :medias, :source => <name>'. Is it one of :artist?