lib/is_reviewable/reviewable.rb
# Calculate average rating for this reviewable object within a domain of reviewers.
#
Calculate average rating for this reviewable object within a domain of reviewers.
Calculate average rating for this reviewable object within a domain of reviewers .
def average_rating_by(identifiers)
        ::Review.average(:rating,
            :conditions => self.reviewer_conditions(identifiers).merge(self.reviewable_conditions)
          ).to_f.round(self.is_reviewable_options[:total_precision])
      end
def average_rating_by ( identifiers ) :: Review . average ( :rating , :conditions => self . reviewer_conditions ( identifiers ) . merge ( self . reviewable_conditions ) ) . to_f . round ( self . is_reviewable_options [ :total_precision ] ) end
Calculate average rating for this reviewable object within a domain of reviewers.
Calculate average rating for this reviewable object within a domain of reviewers .
# FIXME: Only count non-nil ratings, i.e. See "average_rating".
identifiers
<not_specific>