debian-mirror-gitlab/app/uploaders/favicon_uploader.rb
2020-03-13 15:44:24 +05:30

19 lines
397 B
Ruby

# frozen_string_literal: true
class FaviconUploader < AttachmentUploader
include UploadTypeCheck::Concern
EXTENSION_WHITELIST = %w[png ico].freeze
check_upload_type extensions: EXTENSION_WHITELIST
def extension_whitelist
EXTENSION_WHITELIST
end
private
def filename_for_different_format(filename, format)
filename.chomp(File.extname(filename)) + ".#{format}"
end
end