Class: Decidim::Elections::Censuses::TokenCsvForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/elections/censuses/token_csv_form.rb

Overview

This class presents data for logging into the system with census data.

Instance Method Summary collapse

Instance Method Details

#census_userObject



20
21
22
# File 'app/forms/decidim/elections/censuses/token_csv_form.rb', line 20

def census_user
  election.census.users(election).where("data->>'email' = ? AND data->>'token' = ?", email&.strip&.downcase, token&.strip)&.first
end

#electionObject



24
25
26
# File 'app/forms/decidim/elections/censuses/token_csv_form.rb', line 24

def election
  @election ||= context.election
end

#voter_uidObject



16
17
18
# File 'app/forms/decidim/elections/censuses/token_csv_form.rb', line 16

def voter_uid
  @voter_uid ||= census_user&.to_global_id&.to_s
end