favicon_uploader.rb 308 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class FaviconUploader < AttachmentUploader
4 5
  EXTENSION_WHITELIST = %w[png ico].freeze

6
  def extension_whitelist
7
    EXTENSION_WHITELIST
8 9
  end

10 11 12 13 14
  private

  def filename_for_different_format(filename, format)
    filename.chomp(File.extname(filename)) + ".#{format}"
  end
15
end