init comments

This commit is contained in:
Mark Moser committed 2017-02-10 12:55:06 -06:00
1 parent 37f6e49592
commit 9c2b53aa79
8 files changed
+130 -2

No files matched your search

+1
View File
@@ -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
View 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
+1
View File
@@ -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