aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-09-20 18:04:19 +0200
committerDavid Gageot <david@gageot.net>2012-09-21 08:20:32 +0200
commit1e57c80b28fe762436a8d28b25626b2a66d9b098 (patch)
tree7b5059afe2c0760c74fc0621c15a42dafee91f76
parentb4f89bbcc58114f2791260f2a99dad8d41985fda (diff)
downloadsonarqube-1e57c80b28fe762436a8d28b25626b2a66d9b098.tar.gz
sonarqube-1e57c80b28fe762436a8d28b25626b2a66d9b098.zip
SONAR-3754 FIX for multi_values fields. Remove trailing empty values
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/property.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb
index 23d9d2f250d..483a3f6628e 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb
@@ -68,7 +68,9 @@ class Property < ActiveRecord::Base
definition = Java::OrgSonarServerUi::JRubyFacade.getInstance().propertyDefinitions.get(key)
if definition && definition.multi_values
if value.kind_of? Array
- value = value.map { |v| v.gsub(',', '%2C') }.join(',')
+ values = value.map { |v| v.gsub(',', '%2C') }
+ values = values.reverse.drop_while(&:blank?).reverse
+ value = values.join(',')
end
else
if value.kind_of? Array