Class: Decidim::AttachmentUploader
- Inherits:
-
ApplicationUploader
- Object
- ApplicationUploader
- Decidim::AttachmentUploader
- Defined in:
- decidim-core/app/uploaders/decidim/attachment_uploader.rb
Overview
This class deals with uploading attachments to a participatory space.
Instance Method Summary collapse
- #content_type_allowlist ⇒ Object
- #extension_allowlist ⇒ Object
- #max_image_height_or_width ⇒ Object
- #validable_dimensions ⇒ Object
Instance Method Details
#content_type_allowlist ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'decidim-core/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 'decidim-core/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 'decidim-core/app/uploaders/decidim/attachment_uploader.rb', line 35 def max_image_height_or_width 8000 end |
#validable_dimensions ⇒ Object
6 7 8 |
# File 'decidim-core/app/uploaders/decidim/attachment_uploader.rb', line 6 def validable_dimensions true end |