Class: Decidim::Elections::Admin::Censuses::InternalUsersForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Elections::Admin::Censuses::InternalUsersForm
- Defined in:
- app/forms/decidim/elections/admin/censuses/internal_users_form.rb
Instance Method Summary collapse
- #authorization_handler_options(handler_name) ⇒ Object
- #authorization_handlers_names ⇒ Object
-
#available_authorizations ⇒ Object
Helper for the view, at this point, ephemeral authorizations are not supported in the elections module.
-
#census_settings ⇒ Object
Returns the settings that need to be persisted in the census.
- #manifest(handler_name) ⇒ Object
- #options_attributes(handler_name) ⇒ Object
- #options_schema(handler_name) ⇒ Object
- #parsed_authorization_handlers ⇒ Object
Instance Method Details
#authorization_handler_options(handler_name) ⇒ Object
38 39 40 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 38 def (handler_name) &.dig(handler_name.to_s) || &.dig(handler_name, "options").presence || {} end |
#authorization_handlers_names ⇒ Object
34 35 36 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 34 def super.presence || .keys.map(&:to_s) end |
#available_authorizations ⇒ Object
Helper for the view, at this point, ephemeral authorizations are not supported in the elections module.
56 57 58 59 60 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 56 def Decidim..filter do |workflow| .include?(workflow.name) && !workflow.ephemeral? end end |
#census_settings ⇒ Object
Returns the settings that need to be persisted in the census.
17 18 19 20 21 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 17 def census_settings { authorization_handlers: } end |
#manifest(handler_name) ⇒ Object
42 43 44 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 42 def manifest(handler_name) Decidim::Verifications.find_workflow_manifest(handler_name) end |
#options_attributes(handler_name) ⇒ Object
50 51 52 53 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 50 def (handler_name) manifest = (handler_name) manifest ? manifest.attributes : [] end |
#options_schema(handler_name) ⇒ Object
46 47 48 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 46 def (handler_name) (handler_name).schema.new((handler_name)) end |
#parsed_authorization_handlers ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'app/forms/decidim/elections/admin/censuses/internal_users_form.rb', line 23 def .filter_map do |name| next if name.blank? [ name, { options: (name) } ] end.to_h end |