Hi, I’m new to Ruby, having been doing a lot of reading over the last
several weeks and just starting to try out a few things. I have a
project that I would like to do, but I’m not sure what’s the best way to
accomplish the relationships that would like to do. The project is kind
of a contact management application that goes further down the path in
certain areas. Vague, I know, but there real question is:
A contact can belong to one or more categories and, with some of those
categories (but not all), additional information is required and/or
desired to be collected, including foreign keys to other tables. I have
been reading through Agile Web D. and my situation is somewhat
like the single table inheritance (STI) example provided, though
extracted one layer. That is, in the STI example, a person could exist
in only one of the categories.
A more concrete example would be, say, that for a school, a contact can
be an inquiry, an applicant, a student, a teacher, a mentor, etc. In
this scenario, a person could be a student and a mentor at the same
time. Data is collected for applicants and when they are approved, they
become a student (their application data is retained). A student has
other specific information to be collected and can be linked to other
data in the system.
TIA.