Method: RedactorRails::Backend::CarrierWave::InstanceMethods#extract_content_type

Defined in:
lib/redactor-rails/backend/carrierwave.rb

#extract_content_typeObject



40
41
42
43
44
45
46
47
48
# File 'lib/redactor-rails/backend/carrierwave.rb', line 40

def extract_content_type
  if file.content_type == 'application/octet-stream' || file.content_type.blank?
    content_type = MIME::Types.type_for(original_filename).first
  else
    content_type = file.content_type
  end

  model.data_content_type = content_type.to_s
end