Class: Lanes::Concerns::AssetUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
CarrierWave::MiniMagick
Defined in:
lib/lanes/concerns/asset_uploader.rb

Instance Method Summary collapse

Instance Method Details

#cache_dirObject



21
22
23
# File 'lib/lanes/concerns/asset_uploader.rb', line 21

def cache_dir
    '/tmp'
end

#filenameObject



25
26
27
28
29
# File 'lib/lanes/concerns/asset_uploader.rb', line 25

def filename
    if original_filename && model && model.read_attribute(mounted_as).present?
        model.read_attribute(mounted_as)
    end
end

#store_dirObject



31
32
33
34
# File 'lib/lanes/concerns/asset_uploader.rb', line 31

def store_dir
    token = secure_token
    "#{token[0, 2]}/#{token[2, 2]}"
end