new to rails - question about :through and habtm - example

I ran into a similar situation recently. The best I could come up with
was remodelling the structure (as everyone else in this thread have
said) instead of trying to hack around to get it working as it was.
But it could be possible to come up with something by redefining
classes and maybe writing ugly SQL yourself, although I do not believe
that it is the ideal way to do it as far as scalability and (later)
readability is concerned.