How could you simplify or improve this method that checks has_many association for change before looping through and setting a value on each? : Below the code happens before the model is saved, it checks through each answer option to see if the correct_answer is changed on any of the answers if so, it then looks for which was changed and was true.

    if self.answer_options.select{|a| a.correct_answer_changed?}.any?
      self.answer_options.each do |answer_option|
        if answer_option.correct_answer_changed? && !answer_option.correct_answer_was
          answer_option.correct_answer = true
        else
          answer_option.correct_answer = false
        end
      end
    end

