Rails has_many :through: Adding Metadata to Many-to-Many Associations
When a many-to-many relationship needs dates, status, or other attributes, has_many :through transforms the join table into a first-class model that can hold metadata, validations, and advanced queries.