summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-17 16:40:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-17 16:40:43 +0000
commit9cf162108361a01bfd4fd5a59eb42260b96f7281 (patch)
treeef658697801d2c8c5d2ebbdfb8acfb976e22b2c9
parent57923d0450272057be793cd5a81e5fe97e4ed0c9 (diff)
downloadredmine-9cf162108361a01bfd4fd5a59eb42260b96f7281.tar.gz
redmine-9cf162108361a01bfd4fd5a59eb42260b96f7281.zip
code cleanup: rubocop: fix Style/WhenThen in app/models/role.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18724 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml1
-rw-r--r--app/models/role.rb7
2 files changed, 4 insertions, 4 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index a9ac3b4ad..851992d4f 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1464,7 +1464,6 @@ Style/VariableInterpolation:
Style/WhenThen:
Exclude:
- 'app/models/issue_query.rb'
- - 'app/models/role.rb'
# Cop supports --auto-correct.
Style/WhileUntilModifier:
diff --git a/app/models/role.rb b/app/models/role.rb
index 7103c8f70..7fee1b50f 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -160,9 +160,10 @@ class Role < ActiveRecord::Base
def name
case builtin
- when 1; l(:label_role_non_member, :default => read_attribute(:name))
- when 2; l(:label_role_anonymous, :default => read_attribute(:name))
- else; read_attribute(:name)
+ when 1 then l(:label_role_non_member, :default => read_attribute(:name))
+ when 2 then l(:label_role_anonymous, :default => read_attribute(:name))
+ else
+ read_attribute(:name)
end
end