如何为有父亲、母亲和最多两名监护人的孩子建立入学协会?
我知道有很多方法可以设置它,但你会怎么做呢?我不太确定如何设置监护人。我目前正在考虑两种选择,也许你可以推荐第三种。
选项1
Enrollments
belongs_to child
belongs_to father
belongs_to mother
Children
has_one enrollment
has_one father
has_one mother
Father
has_many enrollments
has_many children
Mother
has_many enrollments
has_many children
选项 2
Enrollments
has_and_belongs_to_many adults
Adults
has_and_belongs_to_many enrollments
has_many children
# would have a "relationship: father, mother, guardian"
Children
has_one enrollment
has_one father
has_one mother