Sha256: 8f598071d1d3ea32decea9aa271a0266bd03ac01c8dd71cb9275bb137ed8f494

Contents?: true

Size: 626 Bytes

Versions: 28

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module IdDocuments
      # A form object to be used when public users want to get verified by
      # uploading their identity documents.
      class UploadForm < InformationForm
        mimic :id_document_upload

        attribute :verification_attachment, String

        validates :verification_attachment,
                  file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
                  file_content_type: { allow: ["image/jpeg", "image/png"] },
                  presence: true
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
decidim-verifications-0.9.2 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.9.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.9.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.8.4 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.8.3 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.8.2 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.8.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.8.0 app/forms/decidim/verifications/id_documents/upload_form.rb