I have a Resume data object with a number of detail data objects - Employment, Education, Competencies. These are all one-to-many and straight-forward to code. Each detail object will always have one master Resume object.
I also have an Addresses data object, which is linked to a Resume, and then optionally to any of the detail objects, e.g. the address of an employer (Employment), the address of a school (Education), etc. Each of the detail objects may optionally point to one address.
I am doing this so that all the addresses can be handled in the same way and stored in the same database table for convenience. What is the best way to model this? Each Address object will have a parent that could be a Employment record *or* an Education record.
Would I just set $has_one(Address) for each detail object (Employment, Education, etc) but ignore the relationship in the opposite direction, handling it in code instead?