From 1e57c80b28fe762436a8d28b25626b2a66d9b098 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 20 Sep 2012 18:04:19 +0200 Subject: [PATCH] SONAR-3754 FIX for multi_values fields. Remove trailing empty values --- sonar-server/src/main/webapp/WEB-INF/app/models/property.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.5