Sha256: 7a37de2d39be8811dc0ede229650f4b844ef1f89037311f2f4f2248c811003b6

Contents?: true

Size: 690 Bytes

Versions: 4

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true
module Decidim
  # This class deals with uploading images to Decidim It is intended to just
  # hold the uploads configuration, so you should inherit from this class and
  # then tweak any configuration you need.
  class ApplicationUploader < 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
      default_path = "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"

      return File.join(Decidim.base_uploads_path, default_path) if Decidim.base_uploads_path.present?
      default_path
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-core-0.1.0 app/uploaders/decidim/application_uploader.rb
decidim-core-0.0.8.1 app/uploaders/decidim/application_uploader.rb
decidim-core-0.0.7 app/uploaders/decidim/application_uploader.rb
decidim-core-0.0.6 app/uploaders/decidim/application_uploader.rb