From: David Gageot Date: Thu, 20 Sep 2012 16:04:19 +0000 (+0200) Subject: SONAR-3754 FIX for multi_values fields. Remove trailing empty values X-Git-Tag: 3.3~266 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1e57c80b28fe762436a8d28b25626b2a66d9b098;p=sonarqube.git SONAR-3754 FIX for multi_values fields. Remove trailing empty values --- 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