diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7582fa3c2..2c379d0ae 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1446,7 +1446,6 @@ Style/VariableInterpolation: Style/WhileUntilModifier: Exclude: - 'app/models/attachment.rb' - - 'app/models/project.rb' - 'lib/redmine/unified_diff.rb' - 'lib/redmine/utils.rb' diff --git a/app/models/project.rb b/app/models/project.rb index b04cec68c..948eac1f8 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -868,7 +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