From 0fdaa963aaa861424bca0d3f321bb4406ed73e70 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 19 Oct 2019 11:15:43 +0000 Subject: [PATCH] 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 --- .rubocop_todo.yml | 1 - app/models/project.rb | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) 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