Skip to content

Instantly share code, notes, and snippets.

@petelacey
Created June 8, 2009 16:23
Show Gist options
  • Save petelacey/125916 to your computer and use it in GitHub Desktop.
Save petelacey/125916 to your computer and use it in GitHub Desktop.
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