deliver_later for controller actions.

This commit is contained in:
Mark Moser
2016-09-14 14:38:26 -05:00
parent d54b99135e
commit 9db007489f
10 changed files with 31 additions and 32 deletions

View File

@ -40,19 +40,6 @@ class Candidate < ApplicationRecord
"#{my_status.progress}%"
end
# FIXME: This feels wrong here. Mail deliveries should be in controller.
# Privatize in QuizController
# also, bang methods in ruby do an action and replace, or return nil
def complete!
if update_attributes(completed: true)
CandidateMailer.submitted(self).deliver_now
RecruiterMailer.candidate_submitted(self).deliver_now
ReviewerMailer.candidate_submission(self).deliver_now
return true
end
false
end
private
def generate_test_hash