2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-11-26 14:37:03 +05:30
|
|
|
# Extra methods for uploader
|
|
|
|
module UploaderHelper
|
2018-11-20 20:47:30 +05:30
|
|
|
include Gitlab::FileMarkdownLinkBuilder
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
def extension_match?(extensions)
|
|
|
|
return false unless file
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
extension = file.try(:extension) || File.extname(file.path).delete('.')
|
2016-08-24 12:49:21 +05:30
|
|
|
extensions.include?(extension.downcase)
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
|
|
|
end
|