Sha256: 760680beafe650d197114d6de351a2ca3b8399a495e3eeb8bbee8416c63e41e9

Contents?: true

Size: 431 Bytes

Versions: 3

Compression:

Stored size: 431 Bytes

Contents

module Coupler
  class DataUploader < CarrierWave::Uploader::Base
    def store_dir
      Coupler.upload_path
    end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coupler-0.0.9-java lib/coupler/data_uploader.rb
coupler-0.0.8-java lib/coupler/data_uploader.rb
coupler-0.0.7-java lib/coupler/data_uploader.rb