2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class FaviconUploader < AttachmentUploader
|
2020-03-09 13:42:32 +05:30
|
|
|
include UploadTypeCheck::Concern
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
EXTENSION_WHITELIST = %w[png ico].freeze
|
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
check_upload_type extensions: EXTENSION_WHITELIST
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
def extension_whitelist
|
|
|
|
EXTENSION_WHITELIST
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def filename_for_different_format(filename, format)
|
|
|
|
filename.chomp(File.extname(filename)) + ".#{format}"
|
|
|
|
end
|
|
|
|
end
|