Browse Source

feat: add checkbox clearing behaviour

pull/1687/head
natdeanlewissoftwire 3 years ago
parent
commit
562879bb1e
  1. 4
      app/models/log.rb

4
app/models/log.rb

@ -106,8 +106,12 @@ class Log < ApplicationRecord
errors.each do |error|
next if setup_ids.include?(error.attribute.to_s)
if form.questions.find { |q| q.id == error.attribute.to_s }.type == "checkbox"
question.answer_options.each_key { |attribute| public_send("#{attribute}=", nil) }
else
public_send("#{error.attribute}=", nil)
end
end
blank_compound_invalid_non_setup_fields!

Loading…
Cancel
Save