From: simonbrandhof Date: Thu, 13 Jan 2011 00:02:52 +0000 (+0100) Subject: fix TimeMachine webservice when metric is uncovered_lines or uncovered_conditions X-Git-Tag: 2.6~164 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=21813ecff40f1df35977c0355a84e85c8734afca;p=sonarqube.git fix TimeMachine webservice when metric is uncovered_lines or uncovered_conditions --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb index 03caa8495f5..5f089e9e011 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb @@ -172,12 +172,25 @@ class ProjectMeasure < ActiveRecord::Base end def typed_value - if text_value + case metric().val_type + when Metric::VALUE_TYPE_INT + value + when Metric::VALUE_TYPE_FLOAT + value + when Metric::VALUE_TYPE_PERCENT + value + when Metric::VALUE_TYPE_MILLISEC + value + when Metric::VALUE_TYPE_BOOLEAN + value + when Metric::VALUE_TYPE_LEVEL + text_value + when Metric::VALUE_TYPE_STRING text_value - elsif value - value.to_f + when Metric::VALUE_TYPE_RATING + text_value || value.to_i.to_s else - nil + text_value || value end end