Class: Coupler::DataUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Defined in:
lib/coupler/data_uploader.rb

Instance Method Summary collapse

Instance Method Details

#cache_dirObject



7
8
9
# File 'lib/coupler/data_uploader.rb', line 7

def cache_dir
  File.join(store_dir, 'tmp')
end

#filenameObject



11
12
13
14
15
16
17
18
# File 'lib/coupler/data_uploader.rb', line 11

def filename
  if @filename
    @stored_filename ||= @filename.sub(/\..+?$/, "") + '-' + Digest::SHA1.hexdigest([@filename,
      Time.now.utc, rand].join) + File.extname(@filename)
  else
    super
  end
end

#store_dirObject



3
4
5
# File 'lib/coupler/data_uploader.rb', line 3

def store_dir
  Coupler.upload_path
end