It's not a bug, habtm join tables are working as intended. If a join
model is what you want, use has_many :through.
Adding a surrogate key to a pure join table _certainly_ isn't good db
design. You'll probably want a composite primary key from the two
columns to avoid duplicates.
It's not a bug, habtm join tables are working as intended. If a join
model is what you want, use has_many :through.
This is a bug. Features can be turned off.
Regardless, this 'feature' has surprised, confused, and flustered many
a developer. In this regard it minimally violates the spirit of the
framework. Saying "it's supposed to work that way" misses the point.
The goal is to take the pain out of web development and this is
painful.
Adding a surrogate key to a pure join table _certainly_ isn't good db
design. You'll probably want a composite primary key from the two
columns to avoid duplicates.
I beg to differ. I (and many others) would argue tables should always
have a primary key that has no other use (i.e. don't use composite
keys or keys like SSNs which you *think* won't change but sometimes
do, are harder to index, etc). If you don't you will almost certainly
have messy data problems later.