Class: Rapidfire::Questions::Checkbox
- Inherits:
-
Rapidfire::Question
- Object
- ActiveRecord::Base
- Rapidfire::Question
- Rapidfire::Questions::Checkbox
- Defined in:
- app/models/rapidfire/questions/checkbox.rb
Instance Method Summary collapse
Methods inherited from Rapidfire::Question
Instance Method Details
#options ⇒ Object
6 7 8 |
# File 'app/models/rapidfire/questions/checkbox.rb', line 6 def .split(/\r?\n/) end |
#validate_answer(answer) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/models/rapidfire/questions/checkbox.rb', line 10 def validate_answer(answer) super(answer) if rules[:presence] == "1" || answer.answer_text.present? answer.answer_text.split(",").each do |value| answer.errors.add(:answer_text, :invalid) unless .include?(value) end end end |