In a new rails app, I have to build this sort of relationship
Trip -> 1-to-1 -> Plan
Plan -> n-to-n -> Places
Plan -> n-to-n -> Activities
and ofcourse the vice-versa relationship as well..
The plan
table is something I'm thinking about. Whether it is possible to have a direct Trip -> Places
and Trip -> Activities
relationship without any extra table.
If not, then what could be and efficient way to handle this kind of relationship, keeping in mind that there might be other models which could have a n-to-n relationship with the Plan model in the future.
UPDATE - I found this question and the answer to work. Might be helpful for someone looking to do the same as I am
ActiveRecord, has_many :through, and Polymorphic Associations
Thank you