I’m sure this is a silly question, but I’ve been reading through the
agile rails book and no surprises about using join tables so far.
But I looked into the rails cookbook and it has this to say on the
“The many-to-many relationship between recipes and tags also needs the
help of Active Record declarations. We’ve added has_and_belongs_to_many
:tags to recipes.rb and has_and_belongs_to_many :recipes to tags.rb.
There’s no sign of the intermediate join table, recipes_tags; this is by
design. Active Record handles the complexities of maintaining
many-to-many relationships and provides an intuitive interface for
accessing them from within Rails.”
I also looked through the sitepoint rails book and there wasn’t even a
mention of defining ‘join tables’ for use with has_and_belongs_to_many.
So now I’m confused, agile rails seems like a highly credible book but
as far as I can tell it defines the manual creation of join tables as
necessary, while the other two books either don’t mention them at all or
give the impression they are maintained internally, or at least can be.
I realize I’m probably overlooking something very obvious, but I’ll
accept my humiliation for an answer to my dilemma