So having just learned how to do has_many :through as opposed to HABTM,
and then, being concerned that I wouldn’t get it to work, I started
thinking about these two approaches.
It seems to me that the only problem that the HM:T (has_many :through)
approach solves that HABTM doesn’t is the issue of the potential
collision of id columns between your join table and one of your joined
[ Actually, now that I read the dance-off blog
again, perhaps the other problem is HM:T is better at handling
polymorphic has_many associations? ]
Still, in a simple case, it seems like you could have a HABTM
relationship between two tables that would co-exist with a separate
model on the join table.
So, you’d have A HABTM B and B HABTM A, both specifying a join_table of
C, and then you would also go ahead and create an explicit model for C
so that you could manipulate that table separately.
And since you have to explicitly create the join object anyway in order
to set all of the attributes on it (see:
http://blog.hasmanythrough.com/articles/read/150), wouldn’t that
basically be the same as having a HABTM and then overriding the
appropriate “save” methods in either A or B (or both) to take care of
“fixing” C to be consistent with the A (or B) objects?
Just trying to justify the effort in using this approach.