From c95bead933d8e7d129afd5247268ff7be6f92a55 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 19 Oct 2019 13:34:16 +0000 Subject: [PATCH] code cleanup: rubocop: fix Style/WhileUntilModifier in app/models/attachment.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18783 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 5 ----- app/models/attachment.rb | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a782c472c..378e5dd08 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1437,11 +1437,6 @@ Style/VariableInterpolation: Exclude: - 'lib/redmine/configuration.rb' -# Cop supports --auto-correct. -Style/WhileUntilModifier: - Exclude: - - 'app/models/attachment.rb' - # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinSize, WordRegex. # SupportedStyles: percent, brackets diff --git a/app/models/attachment.rb b/app/models/attachment.rb index afba75e60..8304d4dea 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -506,7 +506,8 @@ class Attachment < ActiveRecord::Base # keep the extension if any ascii << $1 if filename =~ %r{(\.[a-zA-Z0-9]+)$} end - while File.exist?(File.join(storage_path, directory.to_s, "#{timestamp}_#{ascii}")) + while File.exist?(File.join(storage_path, directory.to_s, + "#{timestamp}_#{ascii}")) timestamp.succ! end "#{timestamp}_#{ascii}"