custom error validations
This commit is contained in:
@ -3,4 +3,8 @@ class Answer < ApplicationRecord
|
||||
|
||||
belongs_to :question
|
||||
belongs_to :candidate
|
||||
|
||||
validates :candidate_id, presence: true
|
||||
validates :question_id, presence: true
|
||||
validates :answer, answer_format: true
|
||||
end
|
||||
|
Reference in New Issue
Block a user