app/models/applications/application_reviewer.rb
# Returns the average score for this CommitteeMember for all scores of this criterion.
Returns the average score for this CommitteeMember for all scores of this criterion.
Returns the average score for this CommitteeMember for all scores of this criterion .
def reviewer_average_score(criterion)
    committee_member.application_reviewers.find(:all, 
      :joins => :scores, 
      :select => "AVG(score) AS average_score",
      :conditions => ["application_reviewer_scores.offering_review_criterion_id = #{criterion.id}"]).first.average_score
  end
def reviewer_average_score ( criterion ) committee_member . application_reviewers . find ( :all , :joins => :scores , :select => "AVG(score) AS average_score" , :conditions => [ "application_reviewer_scores.offering_review_criterion_id = #{criterion.id}" ] ) . first . average_score end
Returns the average score for this CommitteeMember for all scores of this criterion.
Returns the average score for this CommitteeMember for all scores of this criterion .
# committee_member.application_reviewers.collect{|r| r.get_score(criterion) rescue nil}.compact.average
criterion