-
-
Save universal/79e150a4025d6b2562e7ca94dfb83faa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Answer < ApplicationRecord | |
| belongs_to :question | |
| belongs_to :student | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Question < ApplicationRecord | |
| has_many :answers | |
| has_many :students, through: :answers | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Student < ApplicationRecord | |
| has_many :answers | |
| has_many :questions, through: :answers | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment