]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Style/WhileUntilModifier in app/models/project.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 19 Oct 2019 11:15:43 +0000 (11:15 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 19 Oct 2019 11:15:43 +0000 (11:15 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18758 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/models/project.rb

index 7582fa3c26f2473e6921c0ae1803e7cb6ad9e21e..2c379d0aee3a7b070b8a5f001d17653bb3ed07cd 100644 (file)
@@ -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'
 
index b04cec68ce37bf99a29c4c24160851666c21adc3..948eac1f8d23ca5827120dade36b92e9a33c47d6 100644 (file)
@@ -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