Class: Decidim::Verifications::IdDocuments::InformationForm
Overview
A form object to be used as the base for identity document verification
Instance Method Summary
collapse
#authorization_attributes, #duplicate, #form_attributes, handler_for, handler_name, #metadata, #to_partial_path, #transferrable?, #unique?, #unique_id, #verification_attachment
Instance Method Details
#document_types_for_select ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'app/forms/decidim/verifications/id_documents/information_form.rb', line 44
def document_types_for_select
document_types.map do |type|
[
I18n.t(type.downcase, scope: "decidim.verifications.id_documents"),
type
]
end
end
|
#handler_name ⇒ Object
26
27
28
|
# File 'app/forms/decidim/verifications/id_documents/information_form.rb', line 26
def handler_name
"id_documents"
end
|
#map_model(model) ⇒ Object
30
31
32
33
34
|
# File 'app/forms/decidim/verifications/id_documents/information_form.rb', line 30
def map_model(model)
self.document_type = model.verification_metadata["document_type"]
self.document_number = model.verification_metadata["document_number"]
self.verification_type = model.verification_metadata["verification_type"].presence || "online"
end
|
#uses_online_method? ⇒ Boolean
53
54
55
|
# File 'app/forms/decidim/verifications/id_documents/information_form.rb', line 53
def uses_online_method?
verification_type == "online"
end
|
36
37
38
39
40
41
42
|
# File 'app/forms/decidim/verifications/id_documents/information_form.rb', line 36
def verification_metadata
{
"document_type" => document_type,
"document_number" => document_number,
"verification_type" => verification_type
}
end
|