aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb5
2 files changed, 5 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb
index 6eb8b76436a..0d474d6fbb8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb
@@ -124,7 +124,7 @@ class Rule < ActiveRecord::Base
def to_hash_json(profile)
json = {'title' => name, 'key' => key, 'plugin' => plugin_name, 'config_key' => config_key}
- json['description'] = description
+ json['description'] = description if description
active_rule = nil
if profile
active_rule = profile.active_by_rule_id(id)
@@ -148,7 +148,7 @@ class Rule < ActiveRecord::Base
xml.key(key)
xml.config_key(config_key)
xml.plugin(plugin_name)
- xml.description { xml.cdata!(description) }
+ xml.description { xml.cdata!(description) } if description
active_rule = nil
if profile
active_rule = profile.active_by_rule_id(id)
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 360b4f988af..9b64bcc6987 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
@@ -114,7 +114,8 @@ class RulesParameter < ActiveRecord::Base
end
def to_hash_json(active_rule)
- json = {'name' => name, 'description' => description}
+ json = {'name' => name}
+ json['description']=description if description
if active_rule
active_parameter = active_rule.active_param_by_param_id(id)
json['value'] = active_parameter.value if active_parameter
@@ -125,7 +126,7 @@ class RulesParameter < ActiveRecord::Base
def to_xml(active_rule, xml)
xml.param do
xml.name(name)
- xml.description { xml.cdata!(description) }
+ xml.description { xml.cdata!(description) } if description
if active_rule
active_parameter = active_rule.active_param_by_param_id(id)
xml.value(active_parameter.value) if active_parameter