Add token string attribute to Poll Answer
This commit is contained in:
@@ -8,6 +8,7 @@ class Poll::Answer < ActiveRecord::Base
|
||||
validates :question, presence: true
|
||||
validates :author, presence: true
|
||||
validates :answer, presence: true
|
||||
validates :token, presence: true
|
||||
|
||||
# temporary skipping validation, review when removing valid_answers
|
||||
# validates :answer, inclusion: { in: ->(a) { a.question.valid_answers }},
|
||||
@@ -19,4 +20,4 @@ class Poll::Answer < ActiveRecord::Base
|
||||
def record_voter_participation
|
||||
Poll::Voter.find_or_create_by!(user: author, poll: poll, origin: "web")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user