diff --git a/app/controllers/admin/poll/questions_controller.rb b/app/controllers/admin/poll/questions_controller.rb index 97b301d43..107c06740 100644 --- a/app/controllers/admin/poll/questions_controller.rb +++ b/app/controllers/admin/poll/questions_controller.rb @@ -56,7 +56,7 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController private def question_params - params.require(:poll_question).permit(:poll_id, :title, :question, :description, :proposal_id, :valid_answers, :video_url, + params.require(:poll_question).permit(:poll_id, :title, :question, :proposal_id, :valid_answers, :video_url, documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]) end diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index a46f28a8c..55396fd3b 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -23,7 +23,6 @@ class Poll::Question < ActiveRecord::Base validates :poll_id, presence: true validates :title, length: { minimum: 4 } - validates :description, length: { maximum: Poll::Question.description_max_length } scope :by_poll_id, ->(poll_id) { where(poll_id: poll_id) } @@ -40,15 +39,10 @@ class Poll::Question < ActiveRecord::Base def searchable_values { title => 'A', proposal.try(:title) => 'A', - description => 'B', author.username => 'C', author_visible_name => 'C' } end - def description - super.try :html_safe - end - def valid_answers (super.try(:split, ',').compact || []).map(&:strip) end @@ -59,7 +53,6 @@ class Poll::Question < ActiveRecord::Base self.author_visible_name = proposal.author.name self.proposal_id = proposal.id self.title = proposal.title - self.description = proposal.description self.valid_answers = I18n.t('poll_questions.default_valid_answers') end end diff --git a/app/views/admin/poll/questions/_form.html.erb b/app/views/admin/poll/questions/_form.html.erb index 7881936e4..6091c024f 100644 --- a/app/views/admin/poll/questions/_form.html.erb +++ b/app/views/admin/poll/questions/_form.html.erb @@ -20,12 +20,6 @@
<%= t("admin.questions.new.valid_answers_note") %>
<%= f.text_field :valid_answers, label: false, aria: {describedby: "valid-answers-help-text"} %> -