Class: Decidim::DirectVerifications::Verification::CreateImportForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/direct_verifications/verification/create_import_form.rb

Constant Summary collapse

ACTIONS =
{
  "in" => :authorize,
  "out" => :revoke,
  "check" => :check
}.freeze

Instance Method Summary collapse

Instance Method Details

#actionObject



31
32
33
34
35
36
37
38
39
# File 'app/forms/decidim/direct_verifications/verification/create_import_form.rb', line 31

def action
  if register && authorize == "in"
    :register_and_authorize
  elsif register
    :register
  else
    ACTIONS[authorize]
  end
end

#available_authorization_handlerObject



25
26
27
28
29
# File 'app/forms/decidim/direct_verifications/verification/create_import_form.rb', line 25

def available_authorization_handler
  return if authorization_handler.in?(organization.available_authorizations)

  errors.add(:authorization_handler, :inclusion)
end