diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-11-01 10:36:46 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-11-01 10:36:46 +0100 |
commit | 8b2339eb3b353d8cece0a8851f35ab8844a1985a (patch) | |
tree | 3f3f7cd45779e9273bc1ee867fe2618af73504be /sonar-server | |
parent | 9aea611d7530ef1023350a82ccb70891cde8a385 (diff) | |
download | sonarqube-8b2339eb3b353d8cece0a8851f35ab8844a1985a.tar.gz sonarqube-8b2339eb3b353d8cece0a8851f35ab8844a1985a.zip |
SONAR-2958 Null description in the web service "rules"
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb | 4 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb | 5 |
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 |