Browse Source

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
tags/4.1.0
Toshi MARUYAMA 4 years ago
parent
commit
c95bead933
2 changed files with 2 additions and 6 deletions
  1. 0
    5
      .rubocop_todo.yml
  2. 2
    1
      app/models/attachment.rb

+ 0
- 5
.rubocop_todo.yml View File

@@ -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

+ 2
- 1
app/models/attachment.rb View File

@@ -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}"

Loading…
Cancel
Save