uploader_helper.rb 331 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4
# Extra methods for uploader
module UploaderHelper
5
  include Gitlab::FileMarkdownLinkBuilder
6

7 8
  private

9
  def extension_match?(extensions)
10 11
    return false unless file

12
    extension = file.try(:extension) || File.extname(file.path).delete('.')
13
    extensions.include?(extension.downcase)
14 15
  end
end