def rate(mark, rater = nil, weight = 1)
      case rater
      when Array
        rater.each{|rater| rate(mark, rater, weight)}
      else
        if !rater
          unless respond_to?(:default_rater)
            raise ArgumentError, "No rater argument and no default_rater specified"
          end
          rater = default_rater
        end
        validate_rater!(rater)
        validate_rating!(mark)
        unrate_without_rating_update(rater)
        total_mark = mark.to_i*weight.to_i
        self.rates += total_mark
        self.rating_marks.new(:rater_id => rater.id, :mark => mark, :rater_class => rater.class.to_s, :weight => weight)
        self.weighted_rate_count += weight
        update_rating
      end
    end
def rate(mark, rater = nil, weight = 1)
      case rater
      when Array
        rater.each{|rater| rate(mark, rater, weight)}
      else
        if !rater
          unless respond_to?(:default_rater)
            raise ArgumentError, "No rater argument and no default_rater specified"
          end
          rater = default_rater
        end
        validate_rater!(rater)
        validate_rating!(mark)
        unrate_without_rating_update(rater)
        total_mark = mark.to_i*weight.to_i
        self.rates += total_mark
        self.rating_marks.new(:rater_id => rater.id, :mark => mark, :rater_class => rater.class.to_s, :weight => weight)
        self.weighted_rate_count += weight
        update_rating
      end
    end
class methods