]> source.dussan.org Git - sonarqube.git/commitdiff
Consistent sort of rule parameters during administration of quality profiles
authorsimonbrandhof <simon.brandhof@gmail.com>
Mon, 13 Feb 2012 10:45:47 +0000 (11:45 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Mon, 13 Feb 2012 13:52:21 +0000 (14:52 +0100)
sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb

index 698c7ad408e715aa187b8ba37e71b90436ebaa25..184f49ec782ec6c3089384bd9a7468b89c345897 100644 (file)
@@ -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