19 lines
385 B
Ruby
19 lines
385 B
Ruby
class Answer < ApplicationRecord
|
|
serialize :answer
|
|
|
|
belongs_to :question
|
|
belongs_to :candidate
|
|
|
|
validates :candidate_id, presence: true
|
|
validates :question_id, presence: true
|
|
validates :answer, answer_format: true
|
|
|
|
# Throw away attributes
|
|
# convenience for form manipulation
|
|
def answer_array=(val); end
|
|
|
|
def answer_hash=(val); end
|
|
|
|
def answer_id=(val); end
|
|
end
|