Browse Source

refactor: simplify wip

pull/1687/head
natdeanlewissoftwire 3 years ago
parent
commit
77430b3c3f
  1. 3
      app/models/log.rb

3
app/models/log.rb

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

Loading…
Cancel
Save