aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-07-27 16:55:54 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-07-27 17:56:51 +0200
commit6027f2add45b5c651a3cebcfbefb0475bdd2a4a7 (patch)
treeb08f34eb1a240fdfd0495b53f3e9e7807d7ecc48
parent98f23e758f5e923262f629e6f8881f56c0cd4604 (diff)
downloadsonarqube-6027f2add45b5c651a3cebcfbefb0475bdd2a4a7.tar.gz
sonarqube-6027f2add45b5c651a3cebcfbefb0475bdd2a4a7.zip
SONAR-2547 fix level type
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb
index 15889260825..72bff3fcf6a 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb
@@ -81,7 +81,7 @@ class ManualMeasure < ActiveRecord::Base
when Metric::VALUE_TYPE_BOOLEAN
value() == 1 ? 'Yes' : 'No'
when Metric::VALUE_TYPE_LEVEL
- Sonar::RulePriority.to_s(value)
+ text_value
when Metric::VALUE_TYPE_STRING
text_value
when Metric::VALUE_TYPE_RATING
@@ -100,8 +100,6 @@ class ManualMeasure < ActiveRecord::Base
value ? value.to_s : ''
elsif metric.value_type==Metric::VALUE_TYPE_BOOLEAN
value ? (value==1 ? 'Yes' : 'No') : ''
- elsif metric.value_type==Metric::VALUE_TYPE_LEVEL
- text_value ? Sonar::RulePriority.to_s(text_value) : ''
else
text_value
end
@@ -133,7 +131,7 @@ class ManualMeasure < ActiveRecord::Base
write_attribute("value", 0.0) if raw_value == "no"
when Metric::VALUE_TYPE_LEVEL
raw_value = text_value.upcase
- errors.add('value', "Value must be BLOCKER, CRITICAL, MAJOR, MINOR or INFO") if !['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'].include?(raw_value)
+ errors.add('value', "Value must be OK, WARN or ERROR") if !['OK', 'WARN', 'ERROR'].include?(raw_value)
write_attribute("value", Sonar::RulePriority.id(raw_value))
write_attribute("text_value", raw_value)
end