Class: Decidim::ApplicationUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Decidim::ApplicationUploader
- Defined in:
- app/uploaders/decidim/application_uploader.rb
Overview
This class deals with uploading files 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.
Direct Known Subclasses
AttachmentUploader, DataPortabilityUploader, ImageUploader, OpenDataUploader
Instance Method Summary collapse
- #skip_ssrf_protection?(_uri) ⇒ Boolean
-
#store_dir ⇒ Object
Override the directory where uploaded files will be stored.
Instance Method Details
#skip_ssrf_protection?(_uri) ⇒ Boolean
20 21 22 |
# File 'app/uploaders/decidim/application_uploader.rb', line 20 def skip_ssrf_protection?(_uri) true end |
#store_dir ⇒ Object
Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted:
12 13 14 15 16 17 18 |
# File 'app/uploaders/decidim/application_uploader.rb', line 12 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 |