Sha256: c692557a44540a5a59bb1adf2593eb93071f5bd913c94aca35062499e1eef517

Contents?: true

Size: 698 Bytes

Versions: 14

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class UploadedFileUploader < CarrierWave::Uploader::Base
    # Override the directory where uploaded files will be stored.
    # This is a sensible default for uploaders that are meant to be mounted:
    def store_dir
      (configured_upload_path / model.class.to_s.underscore / mounted_as.to_s / model.id.to_s).to_s
    end

    def cache_dir
      (configured_cache_path / model.class.to_s.underscore / mounted_as.to_s / model.id.to_s).to_s
    end

    private

    def configured_upload_path
      Pathname.new(Hyrax.config.upload_path.call)
    end

    def configured_cache_path
      Pathname.new(Hyrax.config.cache_path.call)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-5.0.0 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-5.0.0.rc3 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-5.0.0.rc2 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-5.0.0.rc1 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-3.6.0 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-4.0.0 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-4.0.0.rc3 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-4.0.0.rc2 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-4.0.0.rc1 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-3.5.0 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-4.0.0.beta2 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-3.4.2 app/uploaders/hyrax/uploaded_file_uploader.rb
hyrax-4.0.0.beta1 app/uploaders/hyrax/uploaded_file_uploader.rb