Class: PolicyManager::PortabilityRequest

Inherits:
ApplicationRecord show all
Includes:
AASM, Concerns::ActiveStorageBehavior, Concerns::PaperclipBehavior
Defined in:
app/models/policy_manager/portability_request.rb

Instance Method Summary collapse

Instance Method Details

#handle_progressObject



34
35
36
37
# File 'app/models/policy_manager/portability_request.rb', line 34

def handle_progress
  notify_progress
  perform_job
end

#notify_completenessObject



51
52
53
# File 'app/models/policy_manager/portability_request.rb', line 51

def notify_completeness
  PortabilityMailer.completed_notification(self.id).deliver_now
end

#notify_progressObject



43
44
45
# File 'app/models/policy_manager/portability_request.rb', line 43

def notify_progress
  PortabilityMailer.progress_notification(self.id).deliver_now
end

#notify_progress_to_adminObject



47
48
49
# File 'app/models/policy_manager/portability_request.rb', line 47

def notify_progress_to_admin
  PortabilityMailer.admin_notification(self.user.id).deliver_now
end

#perform_jobObject



39
40
41
# File 'app/models/policy_manager/portability_request.rb', line 39

def perform_job
  ExporterJob.set(queue: :default).perform_later(self.user.id)
end

#user_emailObject



30
31
32
# File 'app/models/policy_manager/portability_request.rb', line 30

def user_email
  self.user.email
end