init comments
This commit is contained in:
@ -6,6 +6,7 @@ class Candidate < ApplicationRecord
|
||||
belongs_to :recruiter, class_name: "User"
|
||||
has_many :votes, class_name: "ReviewerVote"
|
||||
has_many :reviewers, through: :quiz
|
||||
has_many :quiz_comments, foreign_key: :test_hash, primary_key: :test_hash
|
||||
|
||||
serialize :email, CryptSerializer
|
||||
|
||||
|
7
app/models/quiz_comment.rb
Normal file
7
app/models/quiz_comment.rb
Normal file
@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
class QuizComment < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :candidate, foreign_key: :test_hash, primary_key: :test_hash
|
||||
|
||||
validates :message, presence: true
|
||||
end
|
@ -5,6 +5,7 @@ class User < ApplicationRecord
|
||||
has_many :reviewer_to_quizzes
|
||||
has_many :quizzes, through: :reviewer_to_quizzes
|
||||
has_many :votes, class_name: 'ReviewerVote'
|
||||
has_many :quiz_comments
|
||||
|
||||
has_many :reviewees, through: :quizzes, source: :candidates
|
||||
|
||||
|
Reference in New Issue
Block a user