Module: Decidim::HasUploadValidations
- Extended by:
- ActiveSupport::Concern
- Included in:
- AccountForm, Attachment, AttachmentForm, Authorization, ContentBlockAttachment, EditorImage, OAuthApplication, Organization, UploadValidationForm, UserBaseEntity, UserGroupForm
- Defined in:
- lib/decidim/has_upload_validations.rb
Instance Method Summary collapse
- #attached_uploader(attached_name) ⇒ Object
- #maximum_avatar_size ⇒ Object
- #maximum_upload_size ⇒ Object
Instance Method Details
#attached_uploader(attached_name) ⇒ Object
55 56 57 58 59 |
# File 'lib/decidim/has_upload_validations.rb', line 55 def attached_uploader(attached_name) uploader = attached_config.dig(attached_name, :uploader) || Decidim::ApplicationUploader uploader.new(self, attached_name) end |
#maximum_avatar_size ⇒ Object
65 66 67 |
# File 'lib/decidim/has_upload_validations.rb', line 65 def maximum_avatar_size Decidim.organization_settings(organization).upload_maximum_file_size_avatar end |
#maximum_upload_size ⇒ Object
61 62 63 |
# File 'lib/decidim/has_upload_validations.rb', line 61 def maximum_upload_size Decidim.organization_settings(organization).upload_maximum_file_size end |