Two-side-polymorphic association - or: how to link multiple models to each other

Hi,

I'm planning an application with a bunch of models which can be linked to each other. Since a few days I'm thinking about the right way to go, to implement these model associations. First thought was, I should use polymorphic associations, but I think it's not enough for my case. I came up with the idea of an explicit link model which would look like this:

LinkModel

i think this might be what you are looking for:

http://wiki.rubyonrails.org/rails/pages/ManytoManyPolymorphicAssociations

Not exactly, but it's a start. That solution is not truly two-sides, as it only implements one of the above SQL statements. Also it's not really beautiful as I it could be?!

tisp