aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-09-06 11:39:39 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-09-06 18:09:03 +0200
commit1e2befd6977596112369b015cf092e1ce88f1b91 (patch)
treed46f7920aabe0941d9777c2824b3ecdb42522d10
parentb43e0c1027b02fce9dcd13641fbb4a38ac80a6fa (diff)
downloadsonarqube-1e2befd6977596112369b015cf092e1ce88f1b91.tar.gz
sonarqube-1e2befd6977596112369b015cf092e1ce88f1b91.zip
Slight refactoring of ColumnView#name()
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb
index 58d7b71408e..47bd1c8f943 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb
@@ -31,17 +31,16 @@ class Sonar::ColumnsView
attr_accessor :id, :name, :col_type, :position, :sort_default
def name(translate=true)
- default_string = @name
- return default_string unless translate
+ return @name unless translate
i18n_key = @id
- return nil if i18n_key.nil?
+ return @name if i18n_key.nil?
if metric_column?
i18n_key = 'metric.' + i18n_key + '.name'
end
- Api::Utils.message(i18n_key, :default => default_string)
+ Api::Utils.message(i18n_key, :default => @name)
end
def project_column?