From: Fabrice Bellingard Date: Fri, 25 May 2012 16:06:26 +0000 (+0200) Subject: SONAR-2706 Search for rule name in the English bundle before DB X-Git-Tag: 3.1~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8e26488fe53000880048ec6965e358d1bc9206a2;p=sonarqube.git SONAR-2706 Search for rule name in the English bundle before DB --- 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 a9d96e1bae5..ec7e9c2b622 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 @@ -80,9 +80,9 @@ class Rule < ActiveRecord::Base else @raw_name ||= begin - result = read_attribute(:name) - # if no name present in the DB, then name is in the English bundle for sure - result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleName("en", repository_key, plugin_rule_key) unless result + result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleName("en", repository_key, plugin_rule_key) + # if no name present in the bundle, try to find it in the DB + result = read_attribute(:name) unless result result end end