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
33 34 35 |
# File 'app/forms/decidim/votings/census/in_person_fields.rb', line 33 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
29 30 31 |
# File 'app/forms/decidim/votings/census/in_person_fields.rb', line 29 def hashed_in_person_data hash_for document_number, document_type, birthdate end |
#options_for_document_type_select ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/forms/decidim/votings/census/in_person_fields.rb', line 37 def DOCUMENT_TYPES.map do |document_type| [ I18n.t(document_type.downcase, scope: "decidim.votings.census.document_types"), document_type ] end end |