Module: ContentTypeWhitelist

Defined in:
app/uploaders/content_type_whitelist.rb

Overview

Currently we run CarrierWave 1.3.1 which means we can not whitelist files by their content type through magic header parsing.

This is a patch to hold us over until we get to CarrierWave 2 :) It's a mashup of CarrierWave's lib/carrierwave/uploader/content_type_whitelist.rb and lib/carrierwave/sanitized_file.rb

Include this concern and add a content_type_whitelist method to get the same behavior as you would with CarrierWave 2.

This is not an exact replacement as we don't override SanitizedFile#content_type but we do set the content_type attribute when we check the whitelist.

Remove this after moving to CarrierWave 2, though on practical terms it shouldn't break anything if left for a while.

Defined Under Namespace

Modules: Concern