Created
October 25, 2016 09:36
-
-
Save anonymous/b2ccb4375625296fdc9fd61c79668f39 to your computer and use it in GitHub Desktop.
This file contains 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 | |
has_one :reply, dependent: :destroy | |
has_one :student, through: :replies | |
end |
This file contains 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 Reply < ApplicationRecord | |
belongs_to :reply | |
belongs_to :student | |
end |
This file contains 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 :replies, dependent: :destroy | |
has_many :answers, through: :replies | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment