habtm and the :id field
I spent all day today discovering something that’s both useful, and frustrating. To put it shortly, having a primary key on the join table for your habtm relationship will cause you problems. But having an :id field that isn’t a primary key does something useful. Want details?
I was trying to figure out how, even though my join table only defined a relationship between two records, ActiveRecord appeared to know which direction that relationship was created in. I have two classes, Product and Language, which have a habtm relationship with one another. If I take a Product p, and a Language l, and do first “p.languages