Module: Decidim::Votings::Census::InPersonFields
- Extended by:
- ActiveSupport::Concern
- Included in:
- InPersonForm
- Defined in:
- app/forms/decidim/votings/census/in_person_fields.rb
Overview
Definition of the fields required to be used on Datum forms for in person voting
Instance Method Summary collapse
- #hash_for(*data) ⇒ Object
-
#hashed_in_person_data ⇒ Object
hash of birth, document type and number used by the polling officer to identify a person.
- #options_for_document_type_select ⇒ Object
Instance Method Details
#hash_for(*data) ⇒ Object
31 32 33 |
# File 'app/forms/decidim/votings/census/in_person_fields.rb', line 31 def hash_for(*data) Digest::SHA256.hexdigest(data.join(".")) end |
#hashed_in_person_data ⇒ Object
hash of birth, document type and number used by the polling officer to identify a person
27 28 29 |
# File 'app/forms/decidim/votings/census/in_person_fields.rb', line 27 def hashed_in_person_data hash_for document_number, document_type, birthdate end |
#options_for_document_type_select ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'app/forms/decidim/votings/census/in_person_fields.rb', line 35 def document_types.map do |document_type| [ I18n.t(document_type.downcase, scope: "decidim.votings.census.document_types"), document_type ] end end |