I have a couple of classes that look like this:
Person {
id(PK)
first_name string
last_name string
}
class Employee {
person_id(FK)
job_description string
}
class Student {
person_id(FK)
school_name string
}
If I had a large list of People, how could I figure out what type each of them are without having to do
Student.where(person_id = person.id).any?
and
Employee.where(person_id = person.id).any?
for every "person" in the list?
I need to do a similar operation very often, so would Single Table Inheritance be a better choice?