나는이 관계가 당신을 위해 일할 수있는 생각 :
class WorkBook
has_many :pages
class Page
belongs_to :work_book
has_many :paragraphs
class Paragraph
belongs_to :page
has_many :questions
class Question
belongs_to :paragraph
has_many :answers
class Answer
belongs_to :question
belongs_to :user
class User
has_many :answers
has_many :answered_questions, class_name: 'Question', through: :answers
답변 (value_string, value_float, value_boolean 등)에 대한 더 나은 제어를 원한다면 추가 모델 "AnswerValue"를 추가하십시오.
이 경우 너무 많은 모델이있는 것처럼 느껴지 겠지만 나를 신뢰하면 앱이 유연 해지고 각 모델/관계에 '세부적인'기능을 추가 할 수 있습니다.
이러한 관계를 가진 확장 : Answer "처럼 작동하는"AnswerCorrection "모델을 추가 할 수 있지만 사용자가 통합 문서를 업데이트 한 후에 다른 값을 저장하는 방법이 될 수 있습니다.
희망이 도움이됩니다.
나를 게시 버튼으로 때려 눕히기 - 이것이 내 답변과 거의 똑같은 것이 좋습니다. – Momer