2016-09-08 10:25:33 -05:00
|
|
|
# frozen_string_literal: true
|
2016-07-26 17:00:00 -05:00
|
|
|
class Answer < ApplicationRecord
|
|
|
|
serialize :answer
|
|
|
|
|
|
|
|
belongs_to :question
|
|
|
|
belongs_to :candidate
|
2016-08-01 09:50:01 -05:00
|
|
|
|
|
|
|
validates :candidate_id, presence: true
|
|
|
|
validates :question_id, presence: true
|
|
|
|
validates :answer, answer_format: true
|
2016-09-07 17:45:50 -05:00
|
|
|
|
|
|
|
# Throw away attributes
|
|
|
|
# convenience for form manipulation
|
|
|
|
def answer_array=(val); end
|
|
|
|
|
|
|
|
def answer_hash=(val); end
|
|
|
|
|
|
|
|
def answer_id=(val); end
|
2016-07-26 17:00:00 -05:00
|
|
|
end
|