aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-01-13 17:25:48 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-01-13 17:25:48 +0100
commit33d67845c7f8271b620e113628765d3acb032f45 (patch)
treeffd4fe1ed811976da6433e0c8315e36bb00f21e3 /sonar-server
parent0734a8b37a4416abc6bf57894e0d5d2c3786c5b4 (diff)
downloadsonarqube-33d67845c7f8271b620e113628765d3acb032f45.tar.gz
sonarqube-33d67845c7f8271b620e113628765d3acb032f45.zip
merge 2.5: fix IT and web service TimeMachine
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb12
1 files changed, 6 insertions, 6 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 5f089e9e011..be2ca947203 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
@@ -174,13 +174,13 @@ class ProjectMeasure < ActiveRecord::Base
def typed_value
case metric().val_type
when Metric::VALUE_TYPE_INT
- value
+ (value ? value.to_i : nil)
when Metric::VALUE_TYPE_FLOAT
- value
+ (value ? value.to_f : nil)
when Metric::VALUE_TYPE_PERCENT
- value
+ (value ? value.to_f : nil)
when Metric::VALUE_TYPE_MILLISEC
- value
+ (value ? value.to_i : nil)
when Metric::VALUE_TYPE_BOOLEAN
value
when Metric::VALUE_TYPE_LEVEL
@@ -188,9 +188,9 @@ class ProjectMeasure < ActiveRecord::Base
when Metric::VALUE_TYPE_STRING
text_value
when Metric::VALUE_TYPE_RATING
- text_value || value.to_i.to_s
+ text_value || (value ? value.to_i : nil)
else
- text_value || value
+ text_value || (value ? value.to_i : nil)
end
end