diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-01-13 01:02:52 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-01-13 01:02:52 +0100 |
commit | 21813ecff40f1df35977c0355a84e85c8734afca (patch) | |
tree | b1044576e979e7cd7c79637474bec04d6643fcef | |
parent | 01dd87a3ee2cd4d8fcdbcd398e3c78f1334e64a7 (diff) | |
download | sonarqube-21813ecff40f1df35977c0355a84e85c8734afca.tar.gz sonarqube-21813ecff40f1df35977c0355a84e85c8734afca.zip |
fix TimeMachine webservice when metric is uncovered_lines or uncovered_conditions
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb | 21 |
1 files changed, 17 insertions, 4 deletions
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 |