custom error validations

This commit is contained in:
Mark Moser
2016-08-01 09:50:01 -05:00
parent dfd582d251
commit 95eec915c4
11 changed files with 79 additions and 24 deletions

View File

@ -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