summaryrefslogtreecommitdiff
path: root/app/uploaders/uploader_helper.rb
blob: e8a2dce775580b5057be1d49a4e461238db82a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

# Extra methods for uploader
module UploaderHelper
  include Gitlab::FileMarkdownLinkBuilder

  private

  def extension_match?(extensions)
    return false unless file

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