The first time programming beginners started learning Rails, huh? The association that is (should) be the point. There are many individual articles about associations, so I tried to sort out the types as a whole.
It can be classified as shown in the table. (This time, the one-to-one association was omitted.)
--Many-to-many requires an intermediate table --Self-join requires a foreign key that references the same model
Recommended Posts