Sha256: cecaa0754500436e6e668fb6994249edc25949a6713ba43353e848f2eba067cf

Contents?: true

Size: 670 Bytes

Versions: 13

Compression:

Stored size: 670 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,
                  if: :uses_online_method?
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-verifications-0.22.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.21.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.20.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.20.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.19.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.18.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.19.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.17.2 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.18.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.17.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.16.1 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.17.0 app/forms/decidim/verifications/id_documents/upload_form.rb
decidim-verifications-0.16.0 app/forms/decidim/verifications/id_documents/upload_form.rb