holderdeord/hdo-site

View on GitHub
lib/hdo/model/has_representatives.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Hdo
  module Model
    module HasRepresentatives

      def percent_of_representatives
        total = Representative.count
        total = 1 if total.zero?

        representatives.size * 100 / total
      end

    end
  end
end