I’ve got two tables, bookmarks & tags. Using a
has_and_belongs_to_many association, I can do lookups using a join
table called bookmarks_tags. Two questions:
Can I have a migration for my join tables? Rails seems to “know”
about join tables implicitly from the associations, but if I do a
rake migrate the join tables won’t be built. I’ve been creating them
using SQL/by hand.
Is there anything wrong with having an ‘id’ column on my join
table? Rails expects:
bookmark_id & tag_id
…but what if I want to reference individual joins? Can I do:
bookmark_id & tag_id & id
Does this mess anything up? The Agile book says don’t do it, articles
on the web say it’s OK. Who to believe?
Thanks for any/all advice!