Carrierwave: change the method name to extension_whitelist for filter uploader file extension

This commit is contained in:
pedong 2019-05-07 13:20:20 +02:00
parent 3435349b66
commit f0ed61cce8
5 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ class AttestationTemplateLogoUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
def extension_whitelist
['jpg', 'jpeg', 'png']
end

View file

@ -20,7 +20,7 @@ class AttestationTemplateSignatureUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
def extension_whitelist
['jpg', 'jpeg', 'png']
end

View file

@ -13,11 +13,11 @@ class CommentaireFileUploader < BaseUploader
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def extension_white_list
def extension_whitelist
['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'jpg', 'jpeg', 'png', 'zip', 'txt']
end
def accept_extension_list
extension_white_list.map { |e| ".#{e}" }.join(",")
extension_whitelist.map { |e| ".#{e}" }.join(",")
end
end

View file

@ -18,7 +18,7 @@ class PieceJustificativeUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
def extension_whitelist
['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'jpg', 'jpeg', 'png']
end

View file

@ -20,7 +20,7 @@ class ProcedureLogoUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
def extension_whitelist
['jpg', 'jpeg', 'png']
end