code cleanup: rubocop: fix Style/ParenthesesAroundCondition in app/models/project.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18832 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2019-10-22 15:54:12 +00:00
parent f4522aeba7
commit 790d2bae70
2 changed files with 2 additions and 3 deletions

View File

@@ -1143,7 +1143,6 @@ Style/ParallelAssignment:
# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
Style/ParenthesesAroundCondition:
Exclude:
- 'app/models/project.rb'
- 'app/models/query.rb'
- 'app/models/repository/subversion.rb'
- 'app/models/time_entry.rb'

View File

@@ -868,8 +868,8 @@ class Project < ActiveRecord::Base
ancestors = projects.first.ancestors.to_a
end
projects.sort_by(&:lft).each do |project|
while (ancestors.any? &&
!project.is_descendant_of?(ancestors.last))
while ancestors.any? &&
!project.is_descendant_of?(ancestors.last)
ancestors.pop
end
yield project, ancestors.size