has_many :through with self-referencial AND polymorphism

here you have an example

http://pastie.org/140772

I hope it helps.

Pedro Del gallego wrote:

Thanks Pedro, this is a first step in the right direction. Now I would like to add support for polymorphism, I mean that the item related could be of different class (this -> related_to -> book, this -> related_to -> image, and so on)

It seems that it's not a simple case (has_many :through - The other side of polymorphic :through associations)

Does it changed with Rails 2.0 ?

I tried the solution provided on the hasmanythrough blog but without success.

Should I go to the has_many_polymorphs plugin ?? (http://blog.evanweaver.com/files/doc/fauna/has_many_polymorphs/files/README.html)

I don't like the idea of overusing plugins when I don't know how to handle a special situation... It's kind of black box in that case

Thanks