1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

cleanup: rubocop: fix Style/MultilineTernaryOperator and Style/NestedTernaryOperator in app/models/issue_relation.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18961 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2019-11-08 14:53:23 +00:00
parent 7bcb299a3c
commit c40714edd1
2 changed files with 5 additions and 5 deletions

View File

@ -1245,7 +1245,6 @@ Style/MultilineTernaryOperator:
- 'app/controllers/workflows_controller.rb' - 'app/controllers/workflows_controller.rb'
- 'app/helpers/settings_helper.rb' - 'app/helpers/settings_helper.rb'
- 'app/models/issue_query.rb' - 'app/models/issue_query.rb'
- 'app/models/issue_relation.rb'
- 'lib/redmine/ciphering.rb' - 'lib/redmine/ciphering.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb' - 'lib/redmine/scm/adapters/filesystem_adapter.rb'
- 'lib/redmine/scm/adapters/git_adapter.rb' - 'lib/redmine/scm/adapters/git_adapter.rb'
@ -1298,7 +1297,6 @@ Style/NestedParenthesizedCalls:
Style/NestedTernaryOperator: Style/NestedTernaryOperator:
Exclude: Exclude:
- 'app/helpers/queries_helper.rb' - 'app/helpers/queries_helper.rb'
- 'app/models/issue_relation.rb'
- 'app/models/journal.rb' - 'app/models/journal.rb'
# Cop supports --auto-correct. # Cop supports --auto-correct.

View File

@ -152,9 +152,11 @@ class IssueRelation < ActiveRecord::Base
end end
def label_for(issue) def label_for(issue)
TYPES[relation_type] ? if TYPES[relation_type]
TYPES[relation_type][(self.issue_from_id == issue.id) ? :name : :sym_name] : TYPES[relation_type][(self.issue_from_id == issue.id) ? :name : :sym_name]
:unknow else
:unknow
end
end end
def to_s(issue=nil) def to_s(issue=nil)