Class: EgovUtils::RegistrationRequests::Create

Inherits:
ActiveInteraction::Base
  • Object
show all
Defined in:
app/services/egov_utils/registration_requests/create.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/services/egov_utils/registration_requests/create.rb', line 14

def execute
  request = RegistrationRequest.create(inputs.merge(status: :pending))

  if request.persisted?
    EgovUtils::RegistrationRequestMailer.created(request.id).deliver_now
    CheckAutoAcceptJob.perform_async(request.id)
  else
    errors.merge!(request.errors)
  end

  request
end