Class: Decidim::Verifications::CsvCensus::ConfirmCensusAuthorization

Inherits:
Decidim::Verifications::ConfirmUserAuthorization show all
Defined in:
decidim-verifications/app/commands/decidim/verifications/csv_census/confirm_census_authorization.rb

Constant Summary

Constants inherited from Decidim::Verifications::ConfirmUserAuthorization

Decidim::Verifications::ConfirmUserAuthorization::MAX_FAILED_ATTEMPTS

Instance Method Summary collapse

Methods inherited from Decidim::Verifications::ConfirmUserAuthorization

#initialize

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction

Constructor Details

This class inherits a constructor from Decidim::Verifications::ConfirmUserAuthorization

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Method Details

#callObject


7
8
9
10
11
12
13
14
15
16
# File 'decidim-verifications/app/commands/decidim/verifications/csv_census/confirm_census_authorization.rb', line 7

def call
  return broadcast(:invalid) unless form.valid?

  if confirmation_successful?
    authorization.grant!
    broadcast(:ok)
  else
    broadcast(:invalid)
  end
end