mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in app/models/attachment.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18781 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
75d3e4037b
commit
d836d9cc69
@ -390,7 +390,6 @@ Lint/HandleExceptions:
|
|||||||
|
|
||||||
Lint/IneffectiveAccessModifier:
|
Lint/IneffectiveAccessModifier:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/attachment.rb'
|
|
||||||
- 'app/models/mail_handler.rb'
|
- 'app/models/mail_handler.rb'
|
||||||
|
|
||||||
Lint/InterpolationCheck:
|
Lint/InterpolationCheck:
|
||||||
|
|||||||
@ -492,9 +492,11 @@ class Attachment < ActiveRecord::Base
|
|||||||
time.strftime("%Y/%m")
|
time.strftime("%Y/%m")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Singleton class method is public
|
||||||
|
class << self
|
||||||
# Returns an ASCII or hashed filename that do not
|
# Returns an ASCII or hashed filename that do not
|
||||||
# exists yet in the given subdirectory
|
# exists yet in the given subdirectory
|
||||||
def self.disk_filename(filename, directory=nil)
|
def disk_filename(filename, directory=nil)
|
||||||
timestamp = DateTime.now.strftime("%y%m%d%H%M%S")
|
timestamp = DateTime.now.strftime("%y%m%d%H%M%S")
|
||||||
ascii = ''
|
ascii = ''
|
||||||
if %r{^[a-zA-Z0-9_\.\-]*$}.match?(filename) && filename.length <= 50
|
if %r{^[a-zA-Z0-9_\.\-]*$}.match?(filename) && filename.length <= 50
|
||||||
@ -509,4 +511,5 @@ class Attachment < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
"#{timestamp}_#{ascii}"
|
"#{timestamp}_#{ascii}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user