# encoding: utf-8

class MissionPatchUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end

  # Provide a default URL as a default if there hasn't been a file uploaded:
  # def default_url
  #   # For Rails 3.1+ asset pipeline compatibility:
  #   # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
  #
  #   "/images/fallback/" + [version_name, "default.png"].compact.join('_')
  # end

  # process :convert => 'svg'

  # version :thumb do
  #   process :resize_to_fit => [250, 250]
  # end
  #
  # version :thumb_2x do
  #   process :resize_to_fit => [500, 500]
  # end
  #
  # version :tiny do
  #   process :resize_to_fit => [100, 100]
  # end

  def extension_white_list
    %w(svg)
  end

  def filename
    "patch.svg" if original_filename
  end

end
