mirror of
https://github.com/redmine/redmine.git
synced 2025-12-17 22:10:27 +01:00
code cleanup: rubocop: fix Style/WhileUntilModifier in app/models/project.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18758 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1446,7 +1446,6 @@ Style/VariableInterpolation:
|
|||||||
Style/WhileUntilModifier:
|
Style/WhileUntilModifier:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/attachment.rb'
|
- 'app/models/attachment.rb'
|
||||||
- 'app/models/project.rb'
|
|
||||||
- 'lib/redmine/unified_diff.rb'
|
- 'lib/redmine/unified_diff.rb'
|
||||||
- 'lib/redmine/utils.rb'
|
- 'lib/redmine/utils.rb'
|
||||||
|
|
||||||
|
|||||||
@@ -868,7 +868,8 @@ class Project < ActiveRecord::Base
|
|||||||
ancestors = projects.first.ancestors.to_a
|
ancestors = projects.first.ancestors.to_a
|
||||||
end
|
end
|
||||||
projects.sort_by(&:lft).each do |project|
|
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
|
ancestors.pop
|
||||||
end
|
end
|
||||||
yield project, ancestors.size
|
yield project, ancestors.size
|
||||||
|
|||||||
Reference in New Issue
Block a user