# encoding: utf-8

class Dunlop::SourceFileUploader < CarrierWave::Uploader::Base

  #storage :file

  # Override the directory where uploaded files will be stored.
  # This is a sensible default for uploaders that are meant to be mounted:
  def store_dir
    File.join(
      Rails.application.config.file_storage_path,
      model.class.to_s.underscore,
      mounted_as.to_s,
      model.id.to_s
    )
  end

  def original_filename
    File.basename(path.to_s)
  end
end
