Hello I have a table that contains days of the week, a table with 48 half hours and values relating to each half hour. Since each day can have many half hours and half hours can have many days do I need a join table for days and hours? also do the values for each half hour need its own table or can I enter those values in the hours table? what is the best way to set this up?
and for rails model associations I would assume the following:
day model:
has_and_belongs_to_many :hours
hours model:
has_and_belongs_to_many :days
If you have a many to many situation a join table is best. You shouldn’t need more than one table for hours, so putting half hours in there should be fine. And that rails model association would be correct as far as I know.