Module: Decidim::HasUploadValidations

Instance Method Summary collapse

Instance Method Details

#attached_uploader(attached_name) ⇒ Object



55
56
57
58
59
# File 'decidim-core/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_sizeObject



65
66
67
# File 'decidim-core/lib/decidim/has_upload_validations.rb', line 65

def maximum_avatar_size
  Decidim.organization_settings(organization).upload_maximum_file_size_avatar
end

#maximum_upload_sizeObject



61
62
63
# File 'decidim-core/lib/decidim/has_upload_validations.rb', line 61

def maximum_upload_size
  Decidim.organization_settings(organization).upload_maximum_file_size
end