HABTM foreign keys

hello,

in a HABTM relationship, does the primary key (category_id, product_id)
of the joint table guarantee that you can’t insert (1,2) twice into the
join table? for instance a category would not list the same product
twice.

i’m just trying to understand the example code given for the section on
Many-to-Many Associations as shown in the first edition of the Agile
w/Rails book.

thanks,

binh

Correct