Class: Decidim::Elections::Admin::ProcessCensus
- Inherits:
-
Commands::UpdateResource
- Object
- Commands::UpdateResource
- Decidim::Elections::Admin::ProcessCensus
- Defined in:
- app/commands/decidim/elections/admin/process_census.rb
Overview
A command with the business logic to create census data for an election.
Instance Method Summary collapse
- #attributes ⇒ Object
- #census_settings ⇒ Object
-
#run_after_hooks ⇒ Object
This will run any post-processing hooks defined in the census manifest.
Instance Method Details
#attributes ⇒ Object
9 10 11 12 13 14 |
# File 'app/commands/decidim/elections/admin/process_census.rb', line 9 def attributes { census_manifest: resource.census.name, census_settings: census_settings } end |
#census_settings ⇒ Object
24 25 26 27 28 |
# File 'app/commands/decidim/elections/admin/process_census.rb', line 24 def census_settings return {} unless form.respond_to?(:census_settings) form.census_settings end |
#run_after_hooks ⇒ Object
This will run any post-processing hooks defined in the census manifest
17 18 19 20 21 22 |
# File 'app/commands/decidim/elections/admin/process_census.rb', line 17 def run_after_hooks command = resource.census.after_update_command&.safe_constantize return unless command command.call(form, resource) end |