Created
June 8, 2009 16:23
-
-
Save petelacey/125916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_answer_code | |
if (question.is_multi_valued? && question.question_element.export_column_id.blank?) | |
begin | |
if question.data_type == :check_box | |
self.code = concat_checkbox_codes | |
else | |
self.code = question.question_element.value_set_element.value_elements.find_by_name(text_answer).code | |
end | |
rescue Exception => ex | |
# Nothing above should cause an exception, unless the form structure is off, in which case this code probably wouldn't even run. Just log a warning. | |
logger.warn ex | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment