Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created January 9, 2009 05:51
Show Gist options
  • Save ahoward/45037 to your computer and use it in GitHub Desktop.
Save ahoward/45037 to your computer and use it in GitHub Desktop.
def has_answered_questionnaire? questionnaire, options = {}
#conditions = conditions_with_context(options)
#questions = questionnaire.questions
#!!Answer.find(:first, :conditions => {:question_id => questions.map(&:id), :user_id => id}.merge(conditions))
all_blank =
questions_and_answers_for(questionnaire, options).answers.all? do |answer|
answer.blank? or answer.answer.blank?
end
not all_blank
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment