[Rails] Re: STI and :through, not working?

2010-10-12 Thread Christian Fazzini
Ok, I got it to work with: @events = @artist.medias.where(:type => 'Event') On Oct 12, 7:53 pm, Erol Fornoles wrote: > That's not how :through works. has_many :through associations are only > used when there is an intermediate model between them. > > What you can do is: > > has_many :medias, :cl

[Rails] Re: STI and :through, not working?

2010-10-12 Thread Erol Fornoles
That's not how :through works. has_many :through associations are only used when there is an intermediate model between them. What you can do is: has_many :medias, :class_name => "Media" # Will return all media, including paintings and videos has_many :paintings, :class_name => "Painting" has_man