]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6222 SQALE Rating is badly render in the timeline widget 121/head
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 27 Feb 2015 13:40:20 +0000 (14:40 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 27 Feb 2015 13:40:20 +0000 (14:40 +0100)
server/sonar-web/src/main/webapp/WEB-INF/app/models/project_measure.rb

index 98af92f13215288e3ed172e505a707afb66a2798..d6aad6e798b4306b9f682e6baf734a78d2bed50b 100644 (file)
@@ -37,12 +37,12 @@ class ProjectMeasure < ActiveRecord::Base
         Metric.by_id(metric_id)
       end
   end
-  
+
   def metric=(m)
     @metric = m
     write_attribute(:metric_id, m.id) if m.id
   end
-  
+
   def rule_measure?
     rule_id || rule_priority
   end
@@ -119,6 +119,8 @@ class ProjectMeasure < ActiveRecord::Base
         millisecs_formatted_value(val)
       when Metric::VALUE_TYPE_WORK_DUR
         work_duration_formatted_value(val)
+      when Metric::VALUE_TYPE_RATING
+        number_with_precision(val, :precision => 0)
       else
         val.to_s
     end
@@ -252,7 +254,7 @@ class ProjectMeasure < ActiveRecord::Base
       metric_key
     end
   end
-  
+
   def metric_key
     metric ? metric.name : nil
   end