Sha256: 5aeb9cfd7fe70733e0484a1c88c05404496296976f0c72124c216ba61f111a0c

Contents?: true

Size: 584 Bytes

Versions: 38

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    class QuestionResultForm < Decidim::Form
      include TranslatableAttributes

      attribute :id, Integer
      translatable_attribute :title, String
      attribute :nota_option, Boolean
      attribute :value, Integer

      validates :id, :value, presence: true
      validates :value, numericality: true

      def map_model(model)
        question = model[:question]
        self.id = question.id
        self.title = question.title
        self.nota_option = question.nota_option?
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.9 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.28.3 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.8 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.28.2 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.7 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.28.1 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.6 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.26.10 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.26.9 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.28.0 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.5 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.28.0.rc5 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.28.0.rc4 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.26.8 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.4 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.3 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.26.7 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.26.5 app/forms/decidim/votings/question_result_form.rb
decidim-elections-0.27.2 app/forms/decidim/votings/question_result_form.rb