gitlab-org--gitlab-foss/app/models/conversational_development_index/metric.rb
Taurie Davis, Simon Knox and Adam Niedzielski 26dde5f55f Add Conversational Development Index page to admin panel
2017-06-01 17:37:21 +02:00

21 lines
472 B
Ruby

module ConversationalDevelopmentIndex
class Metric < ActiveRecord::Base
include Presentable
self.table_name = 'conversational_development_index_metrics'
def instance_score(feature)
self["instance_#{feature}"]
end
def leader_score(feature)
self["leader_#{feature}"]
end
def percentage_score(feature)
return 100 if leader_score(feature).zero?
100 * instance_score(feature) / leader_score(feature)
end
end
end