Add support for open-ended questions in admin section

Introduce a new "open" votation type for poll questions in the admin
interface. This type allows open answers provided by the user.
This commit is contained in:
taitus
2025-08-06 11:12:08 +02:00
parent eb10a3135b
commit 4e57e311dc
12 changed files with 56 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ class Poll::Question < ApplicationRecord
accepts_nested_attributes_for :question_options, reject_if: :all_blank, allow_destroy: true
accepts_nested_attributes_for :votation_type
delegate :multiple?, :vote_type, to: :votation_type, allow_nil: true
delegate :multiple?, :open?, :vote_type, to: :votation_type, allow_nil: true
scope :sort_for_list, -> { order(Arel.sql("poll_questions.proposal_id IS NULL"), :created_at) }
scope :for_render, -> { includes(:author, :proposal) }