Sha256: 7f2ccc80636a8bf45f869dae7874ec4c082b63cdd3f0c72d2899dde8e7719b54

Contents?: true

Size: 410 Bytes

Versions: 6

Compression:

Stored size: 410 Bytes

Contents

module Helena
  module Questions
    class CheckboxGroup < Helena::Question
      include Helena::Concerns::Questions::Requirable

      def includes_subquestions?
        true
      end

      def validate_answers_in(answers)
        errors = {}
        errors[code] = :blank if sub_questions.map { |sub_question| answers[sub_question.code].zero? }.all? && required
        errors
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
helena-2.1.0 app/models/helena/questions/checkbox_group.rb
helena-2.0.2 app/models/helena/questions/checkbox_group.rb
helena-2.0.1 app/models/helena/questions/checkbox_group.rb
helena-2.0.0 app/models/helena/questions/checkbox_group.rb
helena-1.3.1 app/models/helena/questions/checkbox_group.rb
helena-1.3.0 app/models/helena/questions/checkbox_group.rb