Class: Archangel::AssetUploader

Inherits:
ApplicationUploader show all
Defined in:
app/uploaders/archangel/asset_uploader.rb

Overview

Asset uploader

Instance Method Summary collapse

Methods inherited from ApplicationUploader

#default_url, #image?, #store_dir

Instance Method Details

#default_pathString

Uploaded path for file

Returns:

  • (String)

    upload path


30
31
32
# File 'app/uploaders/archangel/asset_uploader.rb', line 30

def default_path
  "archangel/fallback/" + [version_name, "asset.png"].compact.join("_")
end

#extension_whitelistArray

File extension whitelist

Returns:

  • (Array)

    file extension whitelist


21
22
23
# File 'app/uploaders/archangel/asset_uploader.rb', line 21

def extension_whitelist
  Archangel.config.asset_extension_whitelist
end

#filenameString

Uploaded file name

Returns:

  • (String)

    randomly generated file name


39
40
41
# File 'app/uploaders/archangel/asset_uploader.rb', line 39

def filename
  "#{secure_token}.#{file.extension}" if original_filename.present?
end