I have a users table, and a roles table.
I want to make a table like:
model1_model2
with columns:
model1_id
model2_id
other_column int
other_column2 int
Since I need to expose those other columns (other than id’s), do I just make a model that matches this table and call it Module1Module2?
It looks like you’re looking for the
has_and_belongs_to_manyrelationship.You shouldn’t be putting information in a join table unless it describes the relationship between the two models, in which case
has_and_belongs_to_manydoes not apply and you must make a model specifically for the relation.