Sha256: ec84dd83750d19ebfcfcd1bee17a976d0bcdc5e66bcfd94d3e40ea007a055b4d

Contents?: true

Size: 410 Bytes

Versions: 57

Compression:

Stored size: 410 Bytes

Contents

# frozen_string_literal: true

require 'carrierwave'

class ApplicationUploader < CarrierWave::Uploader::Base
  storage :file

  def store_dir
    "system/uploads/#{model.class.model_name.to_s.underscore}/#{mounted_as}/#{id_directory}"
  end

  private

  def id_directory
    if model.respond_to?(:uuid)
      model.reload unless model.uuid.present?
      model.uuid
    else
      model.id
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
tramway-0.1.2 app/uploaders/application_uploader.rb
tramway-0.1.1.1 app/uploaders/application_uploader.rb
tramway-0.1.1 app/uploaders/application_uploader.rb
tramway-core-5.0 app/uploaders/application_uploader.rb
tramway-core-4.1.3.3 app/uploaders/application_uploader.rb
tramway-core-4.1.3.2 app/uploaders/application_uploader.rb
tramway-core-4.1.3.1 app/uploaders/application_uploader.rb
tramway-core-4.1.3 app/uploaders/application_uploader.rb
tramway-core-4.1.2 app/uploaders/application_uploader.rb
tramway-core-4.1.1 app/uploaders/application_uploader.rb
tramway-core-4.1 app/uploaders/application_uploader.rb
tramway-core-4.0.2.1 app/uploaders/application_uploader.rb
tramway-core-4.0.2 app/uploaders/application_uploader.rb
tramway-core-4.0.1.2 app/uploaders/application_uploader.rb
tramway-core-4.0.1.1 app/uploaders/application_uploader.rb
tramway-core-4.0.1 app/uploaders/application_uploader.rb
tramway-core-4.0.0.1 app/uploaders/application_uploader.rb
tramway-core-4.0 app/uploaders/application_uploader.rb
tramway-core-3.0.1.1 app/uploaders/application_uploader.rb
tramway-core-3.0.1 app/uploaders/application_uploader.rb