Class: Decidim::AttachmentUploader
- Inherits:
-
ApplicationUploader
- Object
- ApplicationUploader
- Decidim::AttachmentUploader
- Defined in:
- app/uploaders/decidim/attachment_uploader.rb
Overview
This class deals with uploading attachments to a participatory space.
Instance Attribute Summary
Attributes inherited from ApplicationUploader
#content_type_denylist, #model, #mounted_as
Instance Method Summary collapse
- #content_type_allowlist ⇒ Object
- #extension_allowlist ⇒ Object
- #max_image_height_or_width ⇒ Object
- #validable_dimensions ⇒ Object
Methods inherited from ApplicationUploader
#attached?, #initialize, #path, #remote_url=, set_variants, #store_dir, #url, #variant, #variant_path, #variant_url, variants
Constructor Details
This class inherits a constructor from Decidim::ApplicationUploader
Instance Method Details
#content_type_allowlist ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/uploaders/decidim/attachment_uploader.rb', line 26 def content_type_allowlist case upload_context when :admin Decidim.organization_settings(model).upload_allowed_content_types_admin else Decidim.organization_settings(model).upload_allowed_content_types end end |
#extension_allowlist ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/uploaders/decidim/attachment_uploader.rb', line 17 def extension_allowlist case upload_context when :admin Decidim.organization_settings(model).upload_allowed_file_extensions_admin else Decidim.organization_settings(model).upload_allowed_file_extensions end end |
#max_image_height_or_width ⇒ Object
35 36 37 |
# File 'app/uploaders/decidim/attachment_uploader.rb', line 35 def max_image_height_or_width 8000 end |
#validable_dimensions ⇒ Object
6 7 8 |
# File 'app/uploaders/decidim/attachment_uploader.rb', line 6 def validable_dimensions true end |