Module: Decidim::Votings::Census::InPersonFields

Extended by:
ActiveSupport::Concern
Included in:
InPersonForm
Defined in:
decidim-elections/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

Instance Method Details

#hash_for(*data) ⇒ Object



33
34
35
# File 'decidim-elections/app/forms/decidim/votings/census/in_person_fields.rb', line 33

def hash_for(*data)
  Digest::SHA256.hexdigest(data.join("."))
end

#hashed_in_person_dataObject

hash of birth, document type and number used by the polling officer to identify a person



29
30
31
# File 'decidim-elections/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_selectObject



37
38
39
40
41
42
43
44
# File 'decidim-elections/app/forms/decidim/votings/census/in_person_fields.rb', line 37

def options_for_document_type_select
  DOCUMENT_TYPES.map do |document_type|
    [
      I18n.t(document_type.downcase, scope: "decidim.votings.census.document_types"),
      document_type
    ]
  end
end