diff --git a/app/controllers/admin/poll/questions_controller.rb b/app/controllers/admin/poll/questions_controller.rb
index 5cf587735..64ecf4009 100644
--- a/app/controllers/admin/poll/questions_controller.rb
+++ b/app/controllers/admin/poll/questions_controller.rb
@@ -15,7 +15,6 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController
def new
@polls = Poll.all
- @question.valid_answers = I18n.t('poll_questions.default_valid_answers')
proposal = Proposal.find(params[:proposal_id]) if params[:proposal_id].present?
@question.copy_attributes_from_proposal(proposal)
end
@@ -56,7 +55,7 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController
private
def question_params
- params.require(:poll_question).permit(:poll_id, :title, :question, :proposal_id, :valid_answers, :video_url)
+ params.require(:poll_question).permit(:poll_id, :title, :question, :proposal_id, :video_url)
end
def search_params
diff --git a/app/controllers/officing/results_controller.rb b/app/controllers/officing/results_controller.rb
index 23ef0b038..e3f0bb27c 100644
--- a/app/controllers/officing/results_controller.rb
+++ b/app/controllers/officing/results_controller.rb
@@ -51,7 +51,7 @@ class Officing::ResultsController < Officing::BaseController
results.each_pair do |answer_index, count|
next if count.blank?
- answer = question.valid_answers[answer_index.to_i]
+ answer = question.question_answers.where(given_order: answer_index.to_i + 1).first.title
go_back_to_new if question.blank?
partial_result = ::Poll::PartialResult.find_or_initialize_by(booth_assignment_id: @officer_assignment.booth_assignment_id,
diff --git a/app/views/admin/poll/results/index.html.erb b/app/views/admin/poll/results/index.html.erb
index c65b3ead7..ab4e94857 100644
--- a/app/views/admin/poll/results/index.html.erb
+++ b/app/views/admin/poll/results/index.html.erb
@@ -37,11 +37,11 @@
- <% question.valid_answers.each_with_index do |answer, i| %>
+ <% question.question_answers.each_with_index do |answer, i| %>
<% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
- | <%= answer %> |
- <%= by_answer[answer].present? ? by_answer[answer].sum(&:amount) : 0 %> |
+ <%= answer.title %> |
+ <%= by_answer[answer.title].present? ? by_answer[answer.title].sum(&:amount) : 0 %> |
<% end %>
diff --git a/app/views/officing/results/index.html.erb b/app/views/officing/results/index.html.erb
index 924d7fc13..67b6ece0f 100644
--- a/app/views/officing/results/index.html.erb
+++ b/app/views/officing/results/index.html.erb
@@ -40,11 +40,11 @@
- <% question.valid_answers.each_with_index do |answer, i| %>
+ <% question.question_answers.each_with_index do |answer, i| %>
<% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
- | <%= answer %> |
- <%= by_answer[answer].present? ? by_answer[answer].first.amount : 0 %> |
+ <%= answer.title %> |
+ <%= by_answer[answer.title].present? ? by_answer[answer.title].first.amount : 0 %> |
<% end %>
diff --git a/app/views/officing/results/new.html.erb b/app/views/officing/results/new.html.erb
index fa5f449fb..2f05ca748 100644
--- a/app/views/officing/results/new.html.erb
+++ b/app/views/officing/results/new.html.erb
@@ -27,9 +27,9 @@
<%= question.title %>
- <% question.valid_answers.each_with_index do |answer, i| %>
+ <% question.question_answers.each_with_index do |answer, i| %>
-
+
<%= text_field_tag "questions[#{question.id}][#{i}]", answer_result_value(question.id, i), placeholder: "0" %>
<% end %>
diff --git a/config/locales/en/activerecord.yml b/config/locales/en/activerecord.yml
index bf2cbb712..8ef98b4d1 100644
--- a/config/locales/en/activerecord.yml
+++ b/config/locales/en/activerecord.yml
@@ -156,7 +156,6 @@ en:
description: "Description"
poll/question:
title: "Question"
- valid_answers: "Posibles answers"
summary: "Summary"
description: "Description"
external_url: "Link to additional documentation"
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index 7b3766471..ec1e1e767 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -500,7 +500,6 @@ en:
videos: "External video"
poll_questions:
create_question: "Create question"
- default_valid_answers: "Yes, No"
show:
vote_answer: "Vote %{answer}"
voted: "You have voted %{answer}"
diff --git a/config/locales/es/activerecord.yml b/config/locales/es/activerecord.yml
index f61e3bd53..03de3965d 100644
--- a/config/locales/es/activerecord.yml
+++ b/config/locales/es/activerecord.yml
@@ -150,7 +150,6 @@ es:
description: "Descripción"
poll/question:
title: "Pregunta"
- valid_answers: "Posibles respuestas"
summary: "Resumen"
description: "Descripción"
external_url: "Enlace a documentación adicional"
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 0d2d11a52..c1e71cb33 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -500,7 +500,6 @@ es:
videos: "Vídeo externo"
poll_questions:
create_question: "Crear pregunta para votación"
- default_valid_answers: "Sí, No"
show:
vote_answer: "Votar %{answer}"
voted: "Has votado %{answer}"