From: simonbrandhof Date: Mon, 13 Feb 2012 10:45:47 +0000 (+0100) Subject: Consistent sort of rule parameters during administration of quality profiles X-Git-Tag: 2.14~107 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0b87922a3c36c8ad52bca34c04c44c792f34311a;p=sonarqube.git Consistent sort of rule parameters during administration of quality profiles --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb index 698c7ad408e..184f49ec782 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb @@ -25,19 +25,19 @@ class RulesParameter < ActiveRecord::Base PARAM_TYPE_STRING = "s" PARAM_TYPE_STRING_LIST = "s{}" - PARAM_TYPE_INTEGER = "i"; - PARAM_TYPE_INTEGER_LIST = "i{}"; - PARAM_TYPE_BOOLEAN = "b"; - PARAM_TYPE_REGEXP = "r"; + PARAM_TYPE_INTEGER = "i" + PARAM_TYPE_INTEGER_LIST = "i{}" + PARAM_TYPE_BOOLEAN = "b" + PARAM_TYPE_REGEXP = "r" belongs_to :rule def is_set_type - return param_type.at(1) == "[" && param_type.ends_with?("]") + param_type.at(1) == "[" && param_type.ends_with?("]") end def get_allowed_tokens - return param_type[2, param_type.length-3].split(",") + param_type[2, param_type.length-3].split(",") end def description @@ -134,4 +134,7 @@ class RulesParameter < ActiveRecord::Base end end + def <=>(other) + name <=> other.name + end end