Sha256: 84d4cbf1f29bfc296cadb783c13242edd3801fc6db4ec8c87464f516b7dacf84
Contents?: true
Size: 1.04 KB
Versions: 44
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true module Decidim # This class deals with uploading attachments to a participatory space. class AttachmentUploader < ApplicationUploader def validable_dimensions true end set_variants do { thumbnail: { resize_to_fit: [nil, 237] }, big: { resize_to_limit: [nil, 1000] } } end 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 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 def max_image_height_or_width 8000 end protected def upload_context return :participant unless model.respond_to?(:context) model.context end end end
Version data entries
44 entries across 44 versions & 1 rubygems